aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs5
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs164
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs45
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs156
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs583
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs32
9 files changed, 597 insertions, 399 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 34b2975..313cdca 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -1030,11 +1030,12 @@ namespace OpenSim
1030 delegate(Scene scene) 1030 delegate(Scene scene)
1031 { 1031 {
1032 MainConsole.Instance.Output(String.Format( 1032 MainConsole.Instance.Output(String.Format(
1033 "Region Name: {0}, Region XLoc: {1}, Region YLoc: {2}, Region Port: {3}", 1033 "Region Name: {0}, Region XLoc: {1}, Region YLoc: {2}, Region Port: {3}, Estate Name: {4}",
1034 scene.RegionInfo.RegionName, 1034 scene.RegionInfo.RegionName,
1035 scene.RegionInfo.RegionLocX, 1035 scene.RegionInfo.RegionLocX,
1036 scene.RegionInfo.RegionLocY, 1036 scene.RegionInfo.RegionLocY,
1037 scene.RegionInfo.InternalEndPoint.Port)); 1037 scene.RegionInfo.InternalEndPoint.Port,
1038 scene.RegionInfo.EstateSettings.EstateName));
1038 }); 1039 });
1039 break; 1040 break;
1040 1041
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index cfcc057..b7f9d87 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Diagnostics;
30using System.IO; 31using System.IO;
31using System.Net; 32using System.Net;
32using System.Net.Sockets; 33using System.Net.Sockets;
@@ -639,10 +640,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
639 { 640 {
640 object[] array = new object[] { buffer, packet }; 641 object[] array = new object[] { buffer, packet };
641 642
642 if (m_asyncPacketHandling) 643 Util.FireAndForget(HandleUseCircuitCode, array);
643 Util.FireAndForget(HandleUseCircuitCode, array);
644 else
645 HandleUseCircuitCode(array);
646 644
647 return; 645 return;
648 } 646 }
@@ -859,10 +857,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
859 // Begin the process of adding the client to the simulator 857 // Begin the process of adding the client to the simulator
860 AddNewClient((UseCircuitCodePacket)packet, remoteEndPoint); 858 AddNewClient((UseCircuitCodePacket)packet, remoteEndPoint);
861 859
862 // Acknowledge the UseCircuitCode packet 860 // Send ack
863 SendAckImmediate(remoteEndPoint, packet.Header.Sequence); 861 SendAckImmediate(remoteEndPoint, packet.Header.Sequence);
864 862
865// m_log.DebugFormat( 863 // m_log.DebugFormat(
866// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", 864// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
867// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); 865// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
868 } 866 }
@@ -926,25 +924,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP
926 924
927 protected virtual void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo) 925 protected virtual void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
928 { 926 {
929 // Create the LLUDPClient 927 // In priciple there shouldn't be more than one thread here, ever.
930 LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); 928 // But in case that happens, we need to synchronize this piece of code
931 IClientAPI existingClient; 929 // because it's too important
932 930 lock (this)
933 if (!m_scene.TryGetClient(agentID, out existingClient))
934 { 931 {
935 // Create the LLClientView 932 IClientAPI existingClient;
936 LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
937 client.OnLogout += LogoutHandler;
938 933
939 client.DisableFacelights = m_disableFacelights; 934 if (!m_scene.TryGetClient(agentID, out existingClient))
935 {
936 // Create the LLUDPClient
937 LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
938 // Create the LLClientView
939 LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
940 client.OnLogout += LogoutHandler;
940 941
941 // Start the IClientAPI 942 client.DisableFacelights = m_disableFacelights;
942 client.Start(); 943
943 } 944 // Start the IClientAPI
944 else 945 client.Start();
945 { 946
946 m_log.WarnFormat("[LLUDPSERVER]: Ignoring a repeated UseCircuitCode from {0} at {1} for circuit {2}", 947 }
947 udpClient.AgentID, remoteEndPoint, circuitCode); 948 else
949 {
950 m_log.WarnFormat("[LLUDPSERVER]: Ignoring a repeated UseCircuitCode from {0} at {1} for circuit {2}",
951 existingClient.AgentId, remoteEndPoint, circuitCode);
952 }
948 } 953 }
949 } 954 }
950 955
@@ -1055,6 +1060,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1055 1060
1056 #endregion Update Timers 1061 #endregion Update Timers
1057 1062
1063 // Use this for emergency monitoring -- bug hunting
1064 //if (m_scene.EmergencyMonitoring)
1065 // clientPacketHandler = MonitoredClientOutgoingPacketHandler;
1066 //else
1067 // clientPacketHandler = ClientOutgoingPacketHandler;
1068
1058 // Handle outgoing packets, resends, acknowledgements, and pings for each 1069 // Handle outgoing packets, resends, acknowledgements, and pings for each
1059 // client. m_packetSent will be set to true if a packet is sent 1070 // client. m_packetSent will be set to true if a packet is sent
1060 m_scene.ForEachClient(clientPacketHandler); 1071 m_scene.ForEachClient(clientPacketHandler);
@@ -1070,6 +1081,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1070 { 1081 {
1071 m_log.Error("[LLUDPSERVER]: OutgoingPacketHandler loop threw an exception: " + ex.Message, ex); 1082 m_log.Error("[LLUDPSERVER]: OutgoingPacketHandler loop threw an exception: " + ex.Message, ex);
1072 } 1083 }
1084
1073 } 1085 }
1074 1086
1075 Watchdog.RemoveThread(); 1087 Watchdog.RemoveThread();
@@ -1107,6 +1119,112 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1107 } 1119 }
1108 } 1120 }
1109 1121
1122 #region Emergency Monitoring
1123 // Alternative packet handler fuull of instrumentation
1124 // Handy for hunting bugs
1125 private Stopwatch watch1 = new Stopwatch();
1126 private Stopwatch watch2 = new Stopwatch();
1127
1128 private float avgProcessingTicks = 0;
1129 private float avgResendUnackedTicks = 0;
1130 private float avgSendAcksTicks = 0;
1131 private float avgSendPingTicks = 0;
1132 private float avgDequeueTicks = 0;
1133 private long nticks = 0;
1134 private long nticksUnack = 0;
1135 private long nticksAck = 0;
1136 private long nticksPing = 0;
1137 private int npacksSent = 0;
1138 private int npackNotSent = 0;
1139
1140 private void MonitoredClientOutgoingPacketHandler(IClientAPI client)
1141 {
1142 nticks++;
1143 watch1.Start();
1144 try
1145 {
1146 if (client is LLClientView)
1147 {
1148 LLUDPClient udpClient = ((LLClientView)client).UDPClient;
1149
1150 if (udpClient.IsConnected)
1151 {
1152 if (m_resendUnacked)
1153 {
1154 nticksUnack++;
1155 watch2.Start();
1156
1157 ResendUnacked(udpClient);
1158
1159 watch2.Stop();
1160 avgResendUnackedTicks = (nticksUnack - 1)/(float)nticksUnack * avgResendUnackedTicks + (watch2.ElapsedTicks / (float)nticksUnack);
1161 watch2.Reset();
1162 }
1163
1164 if (m_sendAcks)
1165 {
1166 nticksAck++;
1167 watch2.Start();
1168
1169 SendAcks(udpClient);
1170
1171 watch2.Stop();
1172 avgSendAcksTicks = (nticksAck - 1) / (float)nticksAck * avgSendAcksTicks + (watch2.ElapsedTicks / (float)nticksAck);
1173 watch2.Reset();
1174 }
1175
1176 if (m_sendPing)
1177 {
1178 nticksPing++;
1179 watch2.Start();
1180
1181 SendPing(udpClient);
1182
1183 watch2.Stop();
1184 avgSendPingTicks = (nticksPing - 1) / (float)nticksPing * avgSendPingTicks + (watch2.ElapsedTicks / (float)nticksPing);
1185 watch2.Reset();
1186 }
1187
1188 watch2.Start();
1189 // Dequeue any outgoing packets that are within the throttle limits
1190 if (udpClient.DequeueOutgoing())
1191 {
1192 m_packetSent = true;
1193 npacksSent++;
1194 }
1195 else
1196 npackNotSent++;
1197
1198 watch2.Stop();
1199 avgDequeueTicks = (nticks - 1) / (float)nticks * avgDequeueTicks + (watch2.ElapsedTicks / (float)nticks);
1200 watch2.Reset();
1201
1202 }
1203 else
1204 m_log.WarnFormat("[LLUDPSERVER]: Client is not connected");
1205 }
1206 }
1207 catch (Exception ex)
1208 {
1209 m_log.Error("[LLUDPSERVER]: OutgoingPacketHandler iteration for " + client.Name +
1210 " threw an exception: " + ex.Message, ex);
1211 }
1212 watch1.Stop();
1213 avgProcessingTicks = (nticks - 1) / (float)nticks * avgProcessingTicks + (watch1.ElapsedTicks / (float)nticks);
1214 watch1.Reset();
1215
1216 // reuse this -- it's every ~100ms
1217 if (m_scene.EmergencyMonitoring && nticks % 100 == 0)
1218 {
1219 m_log.InfoFormat("[LLUDPSERVER]: avg processing ticks: {0} avg unacked: {1} avg acks: {2} avg ping: {3} avg dequeue: {4} (TickCountRes: {5} sent: {6} notsent: {7})",
1220 avgProcessingTicks, avgResendUnackedTicks, avgSendAcksTicks, avgSendPingTicks, avgDequeueTicks, TickCountResolution, npacksSent, npackNotSent);
1221 npackNotSent = npacksSent = 0;
1222 }
1223
1224 }
1225
1226 #endregion
1227
1110 private void ProcessInPacket(object state) 1228 private void ProcessInPacket(object state)
1111 { 1229 {
1112 IncomingPacket incomingPacket = (IncomingPacket)state; 1230 IncomingPacket incomingPacket = (IncomingPacket)state;
diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
index d762bef..d195110 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
@@ -141,46 +141,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
141 private void ProcessQueues() 141 private void ProcessQueues()
142 { 142 {
143 // Process all the pending adds 143 // Process all the pending adds
144
145 OutgoingPacket pendingAdd; 144 OutgoingPacket pendingAdd;
146 if (m_pendingAdds != null) 145 while (m_pendingAdds.TryDequeue(out pendingAdd))
147 { 146 if (pendingAdd != null)
148 while (m_pendingAdds.TryDequeue(out pendingAdd)) 147 m_packets[pendingAdd.SequenceNumber] = pendingAdd;
149 {
150 if (pendingAdd != null && m_packets != null)
151 {
152 m_packets[pendingAdd.SequenceNumber] = pendingAdd;
153 }
154 }
155 }
156 148
157 // Process all the pending removes, including updating statistics and round-trip times 149 // Process all the pending removes, including updating statistics and round-trip times
158 PendingAck pendingRemove; 150 PendingAck pendingRemove;
159 OutgoingPacket ackedPacket; 151 OutgoingPacket ackedPacket;
160 if (m_pendingRemoves != null) 152 while (m_pendingRemoves.TryDequeue(out pendingRemove))
161 { 153 {
162 while (m_pendingRemoves.TryDequeue(out pendingRemove)) 154 if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
163 { 155 {
164 if (m_pendingRemoves != null && m_packets != null) 156 if (ackedPacket != null)
165 { 157 {
166 if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) 158 m_packets.Remove(pendingRemove.SequenceNumber);
159
160 // Update stats
161 Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
162
163 if (!pendingRemove.FromResend)
167 { 164 {
168 m_packets.Remove(pendingRemove.SequenceNumber); 165 // Calculate the round-trip time for this packet and its ACK
169 166 int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
170 // Update stats 167 if (rtt > 0)
171 Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); 168 ackedPacket.Client.UpdateRoundTrip(rtt);
172
173 if (!pendingRemove.FromResend)
174 {
175 // Calculate the round-trip time for this packet and its ACK
176 int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
177 if (rtt > 0)
178 ackedPacket.Client.UpdateRoundTrip(rtt);
179 }
180 } 169 }
181 } 170 }
182 } 171 }
183 } 172 }
184 } 173 }
185 } 174 }
186} 175} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs
index 01a2615..66994fa 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs
@@ -139,7 +139,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
139 139
140 if (scene != null) 140 if (scene != null)
141 { 141 {
142 UserAccount account = scene.UserAccountService.GetUserAccount(UUID.Zero, userID); 142 UserAccount account = scene.UserAccountService.GetUserAccount(UUID.Zero, new UUID(userID));
143 isAuthorized = IsAuthorizedForRegion(userID, account.FirstName, account.LastName, 143 isAuthorized = IsAuthorizedForRegion(userID, account.FirstName, account.LastName,
144 account.Email, scene.RegionInfo.RegionName, regionID, out message); 144 account.Email, scene.RegionInfo.RegionName, regionID, out message);
145 } 145 }
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
28using System;
29using System.Collections.Generic;
30using System.IO;
31using System.Reflection;
32using System.Security;
33using log4net;
34using Nini.Config;
35using OpenMetaverse;
36using OpenSim.Framework;
37using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes;
39
40namespace 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 3653842..0652ca7 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
27using System; 28using System;
28using System.Collections.Generic; 29using System.Collections.Generic;
29using System.IO; 30using System.IO;
@@ -45,8 +46,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
45 46
46 private delegate void LookupUUIDS(List<UUID> uuidLst); 47 private delegate void LookupUUIDS(List<UUID> uuidLst);
47 48
48 private Scene m_scene;
49 private Timer m_regionChangeTimer = new Timer(); 49 private Timer m_regionChangeTimer = new Timer();
50 public Scene Scene { get; private set; }
51
52 protected EstateManagementCommands m_commands;
50 53
51 private EstateTerrainXferHandler TerrainUploader; 54 private EstateTerrainXferHandler TerrainUploader;
52 55
@@ -60,89 +63,89 @@ namespace OpenSim.Region.CoreModules.World.Estate
60 { 63 {
61 uint sun = 0; 64 uint sun = 0;
62 65
63 if (!m_scene.RegionInfo.EstateSettings.UseGlobalTime) 66 if (!Scene.RegionInfo.EstateSettings.UseGlobalTime)
64 sun=(uint)(m_scene.RegionInfo.EstateSettings.SunPosition*1024.0) + 0x1800; 67 sun = (uint)(Scene.RegionInfo.EstateSettings.SunPosition * 1024.0) + 0x1800;
65 UUID estateOwner; 68 UUID estateOwner;
66 estateOwner = m_scene.RegionInfo.EstateSettings.EstateOwner; 69 estateOwner = Scene.RegionInfo.EstateSettings.EstateOwner;
67 70
68 if (m_scene.Permissions.IsGod(remote_client.AgentId)) 71 if (Scene.Permissions.IsGod(remote_client.AgentId))
69 estateOwner = remote_client.AgentId; 72 estateOwner = remote_client.AgentId;
70 73
71 remote_client.SendDetailedEstateData(invoice, 74 remote_client.SendDetailedEstateData(invoice,
72 m_scene.RegionInfo.EstateSettings.EstateName, 75 Scene.RegionInfo.EstateSettings.EstateName,
73 m_scene.RegionInfo.EstateSettings.EstateID, 76 Scene.RegionInfo.EstateSettings.EstateID,
74 m_scene.RegionInfo.EstateSettings.ParentEstateID, 77 Scene.RegionInfo.EstateSettings.ParentEstateID,
75 GetEstateFlags(), 78 GetEstateFlags(),
76 sun, 79 sun,
77 m_scene.RegionInfo.RegionSettings.Covenant, 80 Scene.RegionInfo.RegionSettings.Covenant,
78 m_scene.RegionInfo.EstateSettings.AbuseEmail, 81 Scene.RegionInfo.EstateSettings.AbuseEmail,
79 estateOwner); 82 estateOwner);
80 83
81 remote_client.SendEstateList(invoice, 84 remote_client.SendEstateList(invoice,
82 (int)Constants.EstateAccessCodex.EstateManagers, 85 (int)Constants.EstateAccessCodex.EstateManagers,
83 m_scene.RegionInfo.EstateSettings.EstateManagers, 86 Scene.RegionInfo.EstateSettings.EstateManagers,
84 m_scene.RegionInfo.EstateSettings.EstateID); 87 Scene.RegionInfo.EstateSettings.EstateID);
85 88
86 remote_client.SendEstateList(invoice, 89 remote_client.SendEstateList(invoice,
87 (int)Constants.EstateAccessCodex.AccessOptions, 90 (int)Constants.EstateAccessCodex.AccessOptions,
88 m_scene.RegionInfo.EstateSettings.EstateAccess, 91 Scene.RegionInfo.EstateSettings.EstateAccess,
89 m_scene.RegionInfo.EstateSettings.EstateID); 92 Scene.RegionInfo.EstateSettings.EstateID);
90 93
91 remote_client.SendEstateList(invoice, 94 remote_client.SendEstateList(invoice,
92 (int)Constants.EstateAccessCodex.AllowedGroups, 95 (int)Constants.EstateAccessCodex.AllowedGroups,
93 m_scene.RegionInfo.EstateSettings.EstateGroups, 96 Scene.RegionInfo.EstateSettings.EstateGroups,
94 m_scene.RegionInfo.EstateSettings.EstateID); 97 Scene.RegionInfo.EstateSettings.EstateID);
95 98
96 remote_client.SendBannedUserList(invoice, 99 remote_client.SendBannedUserList(invoice,
97 m_scene.RegionInfo.EstateSettings.EstateBans, 100 Scene.RegionInfo.EstateSettings.EstateBans,
98 m_scene.RegionInfo.EstateSettings.EstateID); 101 Scene.RegionInfo.EstateSettings.EstateID);
99 } 102 }
100 103
101 private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, 104 private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor,
102 int matureLevel, bool restrictPushObject, bool allowParcelChanges) 105 int matureLevel, bool restrictPushObject, bool allowParcelChanges)
103 { 106 {
104 if (blockTerraform) 107 if (blockTerraform)
105 m_scene.RegionInfo.RegionSettings.BlockTerraform = true; 108 Scene.RegionInfo.RegionSettings.BlockTerraform = true;
106 else 109 else
107 m_scene.RegionInfo.RegionSettings.BlockTerraform = false; 110 Scene.RegionInfo.RegionSettings.BlockTerraform = false;
108 111
109 if (noFly) 112 if (noFly)
110 m_scene.RegionInfo.RegionSettings.BlockFly = true; 113 Scene.RegionInfo.RegionSettings.BlockFly = true;
111 else 114 else
112 m_scene.RegionInfo.RegionSettings.BlockFly = false; 115 Scene.RegionInfo.RegionSettings.BlockFly = false;
113 116
114 if (allowDamage) 117 if (allowDamage)
115 m_scene.RegionInfo.RegionSettings.AllowDamage = true; 118 Scene.RegionInfo.RegionSettings.AllowDamage = true;
116 else 119 else
117 m_scene.RegionInfo.RegionSettings.AllowDamage = false; 120 Scene.RegionInfo.RegionSettings.AllowDamage = false;
118 121
119 if (blockLandResell) 122 if (blockLandResell)
120 m_scene.RegionInfo.RegionSettings.AllowLandResell = false; 123 Scene.RegionInfo.RegionSettings.AllowLandResell = false;
121 else 124 else
122 m_scene.RegionInfo.RegionSettings.AllowLandResell = true; 125 Scene.RegionInfo.RegionSettings.AllowLandResell = true;
123 126
124 m_scene.RegionInfo.RegionSettings.AgentLimit = (byte) maxAgents; 127 Scene.RegionInfo.RegionSettings.AgentLimit = (byte) maxAgents;
125 128
126 m_scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor; 129 Scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor;
127 130
128 if (matureLevel <= 13) 131 if (matureLevel <= 13)
129 m_scene.RegionInfo.RegionSettings.Maturity = 0; 132 Scene.RegionInfo.RegionSettings.Maturity = 0;
130 else if (matureLevel <= 21) 133 else if (matureLevel <= 21)
131 m_scene.RegionInfo.RegionSettings.Maturity = 1; 134 Scene.RegionInfo.RegionSettings.Maturity = 1;
132 else 135 else
133 m_scene.RegionInfo.RegionSettings.Maturity = 2; 136 Scene.RegionInfo.RegionSettings.Maturity = 2;
134 137
135 if (restrictPushObject) 138 if (restrictPushObject)
136 m_scene.RegionInfo.RegionSettings.RestrictPushing = true; 139 Scene.RegionInfo.RegionSettings.RestrictPushing = true;
137 else 140 else
138 m_scene.RegionInfo.RegionSettings.RestrictPushing = false; 141 Scene.RegionInfo.RegionSettings.RestrictPushing = false;
139 142
140 if (allowParcelChanges) 143 if (allowParcelChanges)
141 m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide = true; 144 Scene.RegionInfo.RegionSettings.AllowLandJoinDivide = true;
142 else 145 else
143 m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide = false; 146 Scene.RegionInfo.RegionSettings.AllowLandJoinDivide = false;
144 147
145 m_scene.RegionInfo.RegionSettings.Save(); 148 Scene.RegionInfo.RegionSettings.Save();
146 TriggerRegionInfoChange(); 149 TriggerRegionInfoChange();
147 150
148 sendRegionInfoPacketToAll(); 151 sendRegionInfoPacketToAll();
@@ -156,19 +159,19 @@ namespace OpenSim.Region.CoreModules.World.Estate
156 switch (corner) 159 switch (corner)
157 { 160 {
158 case 0: 161 case 0:
159 m_scene.RegionInfo.RegionSettings.TerrainTexture1 = texture; 162 Scene.RegionInfo.RegionSettings.TerrainTexture1 = texture;
160 break; 163 break;
161 case 1: 164 case 1:
162 m_scene.RegionInfo.RegionSettings.TerrainTexture2 = texture; 165 Scene.RegionInfo.RegionSettings.TerrainTexture2 = texture;
163 break; 166 break;
164 case 2: 167 case 2:
165 m_scene.RegionInfo.RegionSettings.TerrainTexture3 = texture; 168 Scene.RegionInfo.RegionSettings.TerrainTexture3 = texture;
166 break; 169 break;
167 case 3: 170 case 3:
168 m_scene.RegionInfo.RegionSettings.TerrainTexture4 = texture; 171 Scene.RegionInfo.RegionSettings.TerrainTexture4 = texture;
169 break; 172 break;
170 } 173 }
171 m_scene.RegionInfo.RegionSettings.Save(); 174 Scene.RegionInfo.RegionSettings.Save();
172 TriggerRegionInfoChange(); 175 TriggerRegionInfoChange();
173 sendRegionInfoPacketToAll(); 176 sendRegionInfoPacketToAll();
174 } 177 }
@@ -178,23 +181,23 @@ namespace OpenSim.Region.CoreModules.World.Estate
178 switch (corner) 181 switch (corner)
179 { 182 {
180 case 0: 183 case 0:
181 m_scene.RegionInfo.RegionSettings.Elevation1SW = lowValue; 184 Scene.RegionInfo.RegionSettings.Elevation1SW = lowValue;
182 m_scene.RegionInfo.RegionSettings.Elevation2SW = highValue; 185 Scene.RegionInfo.RegionSettings.Elevation2SW = highValue;
183 break; 186 break;
184 case 1: 187 case 1:
185 m_scene.RegionInfo.RegionSettings.Elevation1NW = lowValue; 188 Scene.RegionInfo.RegionSettings.Elevation1NW = lowValue;
186 m_scene.RegionInfo.RegionSettings.Elevation2NW = highValue; 189 Scene.RegionInfo.RegionSettings.Elevation2NW = highValue;
187 break; 190 break;
188 case 2: 191 case 2:
189 m_scene.RegionInfo.RegionSettings.Elevation1SE = lowValue; 192 Scene.RegionInfo.RegionSettings.Elevation1SE = lowValue;
190 m_scene.RegionInfo.RegionSettings.Elevation2SE = highValue; 193 Scene.RegionInfo.RegionSettings.Elevation2SE = highValue;
191 break; 194 break;
192 case 3: 195 case 3:
193 m_scene.RegionInfo.RegionSettings.Elevation1NE = lowValue; 196 Scene.RegionInfo.RegionSettings.Elevation1NE = lowValue;
194 m_scene.RegionInfo.RegionSettings.Elevation2NE = highValue; 197 Scene.RegionInfo.RegionSettings.Elevation2NE = highValue;
195 break; 198 break;
196 } 199 }
197 m_scene.RegionInfo.RegionSettings.Save(); 200 Scene.RegionInfo.RegionSettings.Save();
198 TriggerRegionInfoChange(); 201 TriggerRegionInfoChange();
199 sendRegionInfoPacketToAll(); 202 sendRegionInfoPacketToAll();
200 } 203 }
@@ -210,30 +213,30 @@ namespace OpenSim.Region.CoreModules.World.Estate
210 bool UseGlobal, bool EstateFixedSun, float EstateSunHour) 213 bool UseGlobal, bool EstateFixedSun, float EstateSunHour)
211 { 214 {
212 // Water Height 215 // Water Height
213 m_scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight; 216 Scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight;
214 217
215 // Terraforming limits 218 // Terraforming limits
216 m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit = TerrainRaiseLimit; 219 Scene.RegionInfo.RegionSettings.TerrainRaiseLimit = TerrainRaiseLimit;
217 m_scene.RegionInfo.RegionSettings.TerrainLowerLimit = TerrainLowerLimit; 220 Scene.RegionInfo.RegionSettings.TerrainLowerLimit = TerrainLowerLimit;
218 221
219 // Time of day / fixed sun 222 // Time of day / fixed sun
220 m_scene.RegionInfo.RegionSettings.UseEstateSun = UseEstateSun; 223 Scene.RegionInfo.RegionSettings.UseEstateSun = UseEstateSun;
221 m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun; 224 Scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun;
222 m_scene.RegionInfo.RegionSettings.SunPosition = SunHour; 225 Scene.RegionInfo.RegionSettings.SunPosition = SunHour;
223 226
224 m_scene.TriggerEstateSunUpdate(); 227 Scene.TriggerEstateSunUpdate();
225 228
226 //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString()); 229 //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString());
227 //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString()); 230 //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString());
228 231
229 sendRegionInfoPacketToAll(); 232 sendRegionInfoPacketToAll();
230 m_scene.RegionInfo.RegionSettings.Save(); 233 Scene.RegionInfo.RegionSettings.Save();
231 TriggerRegionInfoChange(); 234 TriggerRegionInfoChange();
232 } 235 }
233 236
234 private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds) 237 private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds)
235 { 238 {
236 IRestartModule restartModule = m_scene.RequestModuleInterface<IRestartModule>(); 239 IRestartModule restartModule = Scene.RequestModuleInterface<IRestartModule>();
237 if (restartModule != null) 240 if (restartModule != null)
238 { 241 {
239 List<int> times = new List<int>(); 242 List<int> times = new List<int>();
@@ -254,8 +257,8 @@ namespace OpenSim.Region.CoreModules.World.Estate
254 257
255 private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) 258 private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID)
256 { 259 {
257 m_scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; 260 Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID;
258 m_scene.RegionInfo.RegionSettings.Save(); 261 Scene.RegionInfo.RegionSettings.Save();
259 TriggerRegionInfoChange(); 262 TriggerRegionInfoChange();
260 } 263 }
261 264
@@ -263,17 +266,17 @@ namespace OpenSim.Region.CoreModules.World.Estate
263 { 266 {
264 // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc. 267 // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc.
265 268
266 if (user == m_scene.RegionInfo.EstateSettings.EstateOwner) 269 if (user == Scene.RegionInfo.EstateSettings.EstateOwner)
267 return; // never process EO 270 return; // never process EO
268 271
269 if ((estateAccessType & 4) != 0) // User add 272 if ((estateAccessType & 4) != 0) // User add
270 { 273 {
271 if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) 274 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions())
272 { 275 {
273 m_scene.RegionInfo.EstateSettings.AddEstateUser(user); 276 Scene.RegionInfo.EstateSettings.AddEstateUser(user);
274 m_scene.RegionInfo.EstateSettings.Save(); 277 Scene.RegionInfo.EstateSettings.Save();
275 TriggerEstateInfoChange(); 278 TriggerEstateInfoChange();
276 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); 279 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID);
277 } 280 }
278 else 281 else
279 { 282 {
@@ -283,13 +286,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
283 } 286 }
284 if ((estateAccessType & 8) != 0) // User remove 287 if ((estateAccessType & 8) != 0) // User remove
285 { 288 {
286 if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) 289 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions())
287 { 290 {
288 m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user); 291 Scene.RegionInfo.EstateSettings.RemoveEstateUser(user);
289 m_scene.RegionInfo.EstateSettings.Save(); 292 Scene.RegionInfo.EstateSettings.Save();
290 TriggerEstateInfoChange(); 293 TriggerEstateInfoChange();
291 294
292 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); 295 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID);
293 } 296 }
294 else 297 else
295 { 298 {
@@ -298,12 +301,12 @@ namespace OpenSim.Region.CoreModules.World.Estate
298 } 301 }
299 if ((estateAccessType & 16) != 0) // Group add 302 if ((estateAccessType & 16) != 0) // Group add
300 { 303 {
301 if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) 304 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions())
302 { 305 {
303 m_scene.RegionInfo.EstateSettings.AddEstateGroup(user); 306 Scene.RegionInfo.EstateSettings.AddEstateGroup(user);
304 m_scene.RegionInfo.EstateSettings.Save(); 307 Scene.RegionInfo.EstateSettings.Save();
305 TriggerEstateInfoChange(); 308 TriggerEstateInfoChange();
306 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); 309 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID);
307 } 310 }
308 else 311 else
309 { 312 {
@@ -312,13 +315,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
312 } 315 }
313 if ((estateAccessType & 32) != 0) // Group remove 316 if ((estateAccessType & 32) != 0) // Group remove
314 { 317 {
315 if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) 318 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions())
316 { 319 {
317 m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); 320 Scene.RegionInfo.EstateSettings.RemoveEstateGroup(user);
318 m_scene.RegionInfo.EstateSettings.Save(); 321 Scene.RegionInfo.EstateSettings.Save();
319 TriggerEstateInfoChange(); 322 TriggerEstateInfoChange();
320 323
321 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); 324 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID);
322 } 325 }
323 else 326 else
324 { 327 {
@@ -327,9 +330,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
327 } 330 }
328 if ((estateAccessType & 64) != 0) // Ban add 331 if ((estateAccessType & 64) != 0) // Ban add
329 { 332 {
330 if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) 333 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || Scene.Permissions.BypassPermissions())
331 { 334 {
332 EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; 335 EstateBan[] banlistcheck = Scene.RegionInfo.EstateSettings.EstateBans;
333 336
334 bool alreadyInList = false; 337 bool alreadyInList = false;
335 338
@@ -348,20 +351,20 @@ namespace OpenSim.Region.CoreModules.World.Estate
348 EstateBan item = new EstateBan(); 351 EstateBan item = new EstateBan();
349 352
350 item.BannedUserID = user; 353 item.BannedUserID = user;
351 item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID; 354 item.EstateID = Scene.RegionInfo.EstateSettings.EstateID;
352 item.BannedHostAddress = "0.0.0.0"; 355 item.BannedHostAddress = "0.0.0.0";
353 item.BannedHostIPMask = "0.0.0.0"; 356 item.BannedHostIPMask = "0.0.0.0";
354 357
355 m_scene.RegionInfo.EstateSettings.AddBan(item); 358 Scene.RegionInfo.EstateSettings.AddBan(item);
356 m_scene.RegionInfo.EstateSettings.Save(); 359 Scene.RegionInfo.EstateSettings.Save();
357 TriggerEstateInfoChange(); 360 TriggerEstateInfoChange();
358 361
359 ScenePresence s = m_scene.GetScenePresence(user); 362 ScenePresence s = Scene.GetScenePresence(user);
360 if (s != null) 363 if (s != null)
361 { 364 {
362 if (!s.IsChildAgent) 365 if (!s.IsChildAgent)
363 { 366 {
364 if (!m_scene.TeleportClientHome(user, s.ControllingClient)) 367 if (!Scene.TeleportClientHome(user, s.ControllingClient))
365 { 368 {
366 s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out."); 369 s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out.");
367 s.ControllingClient.Close(); 370 s.ControllingClient.Close();
@@ -375,7 +378,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
375 remote_client.SendAlertMessage("User is already on the region ban list"); 378 remote_client.SendAlertMessage("User is already on the region ban list");
376 } 379 }
377 //m_scene.RegionInfo.regionBanlist.Add(Manager(user); 380 //m_scene.RegionInfo.regionBanlist.Add(Manager(user);
378 remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); 381 remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID);
379 } 382 }
380 else 383 else
381 { 384 {
@@ -384,9 +387,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
384 } 387 }
385 if ((estateAccessType & 128) != 0) // Ban remove 388 if ((estateAccessType & 128) != 0) // Ban remove
386 { 389 {
387 if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) 390 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || Scene.Permissions.BypassPermissions())
388 { 391 {
389 EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; 392 EstateBan[] banlistcheck = Scene.RegionInfo.EstateSettings.EstateBans;
390 393
391 bool alreadyInList = false; 394 bool alreadyInList = false;
392 EstateBan listitem = null; 395 EstateBan listitem = null;
@@ -399,20 +402,21 @@ namespace OpenSim.Region.CoreModules.World.Estate
399 listitem = banlistcheck[i]; 402 listitem = banlistcheck[i];
400 break; 403 break;
401 } 404 }
402
403 } 405 }
406
404 if (alreadyInList && listitem != null) 407 if (alreadyInList && listitem != null)
405 { 408 {
406 m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); 409 Scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID);
407 m_scene.RegionInfo.EstateSettings.Save(); 410 Scene.RegionInfo.EstateSettings.Save();
408 TriggerEstateInfoChange(); 411 TriggerEstateInfoChange();
409 } 412 }
410 else 413 else
411 { 414 {
412 remote_client.SendAlertMessage("User is not on the region ban list"); 415 remote_client.SendAlertMessage("User is not on the region ban list");
413 } 416 }
417
414 //m_scene.RegionInfo.regionBanlist.Add(Manager(user); 418 //m_scene.RegionInfo.regionBanlist.Add(Manager(user);
415 remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); 419 remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID);
416 } 420 }
417 else 421 else
418 { 422 {
@@ -421,12 +425,12 @@ namespace OpenSim.Region.CoreModules.World.Estate
421 } 425 }
422 if ((estateAccessType & 256) != 0) // Manager add 426 if ((estateAccessType & 256) != 0) // Manager add
423 { 427 {
424 if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) 428 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions())
425 { 429 {
426 m_scene.RegionInfo.EstateSettings.AddEstateManager(user); 430 Scene.RegionInfo.EstateSettings.AddEstateManager(user);
427 m_scene.RegionInfo.EstateSettings.Save(); 431 Scene.RegionInfo.EstateSettings.Save();
428 TriggerEstateInfoChange(); 432 TriggerEstateInfoChange();
429 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); 433 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID);
430 } 434 }
431 else 435 else
432 { 436 {
@@ -435,13 +439,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
435 } 439 }
436 if ((estateAccessType & 512) != 0) // Manager remove 440 if ((estateAccessType & 512) != 0) // Manager remove
437 { 441 {
438 if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) 442 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions())
439 { 443 {
440 m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); 444 Scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
441 m_scene.RegionInfo.EstateSettings.Save(); 445 Scene.RegionInfo.EstateSettings.Save();
442 TriggerEstateInfoChange(); 446 TriggerEstateInfoChange();
443 447
444 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); 448 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID);
445 } 449 }
446 else 450 else
447 { 451 {
@@ -453,7 +457,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
453 private void SendSimulatorBlueBoxMessage( 457 private void SendSimulatorBlueBoxMessage(
454 IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) 458 IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message)
455 { 459 {
456 IDialogModule dm = m_scene.RequestModuleInterface<IDialogModule>(); 460 IDialogModule dm = Scene.RequestModuleInterface<IDialogModule>();
457 461
458 if (dm != null) 462 if (dm != null)
459 dm.SendNotificationToUsersInRegion(senderID, senderName, message); 463 dm.SendNotificationToUsersInRegion(senderID, senderName, message);
@@ -468,38 +472,38 @@ namespace OpenSim.Region.CoreModules.World.Estate
468 private void handleEstateDebugRegionRequest(IClientAPI remote_client, UUID invoice, UUID senderID, bool scripted, bool collisionEvents, bool physics) 472 private void handleEstateDebugRegionRequest(IClientAPI remote_client, UUID invoice, UUID senderID, bool scripted, bool collisionEvents, bool physics)
469 { 473 {
470 if (physics) 474 if (physics)
471 m_scene.RegionInfo.RegionSettings.DisablePhysics = true; 475 Scene.RegionInfo.RegionSettings.DisablePhysics = true;
472 else 476 else
473 m_scene.RegionInfo.RegionSettings.DisablePhysics = false; 477 Scene.RegionInfo.RegionSettings.DisablePhysics = false;
474 478
475 if (scripted) 479 if (scripted)
476 m_scene.RegionInfo.RegionSettings.DisableScripts = true; 480 Scene.RegionInfo.RegionSettings.DisableScripts = true;
477 else 481 else
478 m_scene.RegionInfo.RegionSettings.DisableScripts = false; 482 Scene.RegionInfo.RegionSettings.DisableScripts = false;
479 483
480 if (collisionEvents) 484 if (collisionEvents)
481 m_scene.RegionInfo.RegionSettings.DisableCollisions = true; 485 Scene.RegionInfo.RegionSettings.DisableCollisions = true;
482 else 486 else
483 m_scene.RegionInfo.RegionSettings.DisableCollisions = false; 487 Scene.RegionInfo.RegionSettings.DisableCollisions = false;
484 488
485 489
486 m_scene.RegionInfo.RegionSettings.Save(); 490 Scene.RegionInfo.RegionSettings.Save();
487 TriggerRegionInfoChange(); 491 TriggerRegionInfoChange();
488 492
489 m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics); 493 Scene.SetSceneCoreDebug(scripted, collisionEvents, physics);
490 } 494 }
491 495
492 private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey) 496 private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey)
493 { 497 {
494 if (!m_scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false)) 498 if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false))
495 return; 499 return;
496 500
497 if (prey != UUID.Zero) 501 if (prey != UUID.Zero)
498 { 502 {
499 ScenePresence s = m_scene.GetScenePresence(prey); 503 ScenePresence s = Scene.GetScenePresence(prey);
500 if (s != null) 504 if (s != null)
501 { 505 {
502 if (!m_scene.TeleportClientHome(prey, s.ControllingClient)) 506 if (!Scene.TeleportClientHome(prey, s.ControllingClient))
503 { 507 {
504 s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out."); 508 s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
505 s.ControllingClient.Close(); 509 s.ControllingClient.Close();
@@ -510,19 +514,19 @@ namespace OpenSim.Region.CoreModules.World.Estate
510 514
511 private void handleEstateTeleportAllUsersHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID) 515 private void handleEstateTeleportAllUsersHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID)
512 { 516 {
513 if (!m_scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false)) 517 if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false))
514 return; 518 return;
515 519
516 m_scene.ForEachScenePresence(delegate(ScenePresence sp) 520 Scene.ForEachScenePresence(delegate(ScenePresence sp)
517 { 521 {
518 if (sp.UUID != senderID) 522 if (sp.UUID != senderID)
519 { 523 {
520 ScenePresence p = m_scene.GetScenePresence(sp.UUID); 524 ScenePresence p = Scene.GetScenePresence(sp.UUID);
521 // make sure they are still there, we could be working down a long list 525 // make sure they are still there, we could be working down a long list
522 // Also make sure they are actually in the region 526 // Also make sure they are actually in the region
523 if (p != null && !p.IsChildAgent) 527 if (p != null && !p.IsChildAgent)
524 { 528 {
525 if (!m_scene.TeleportClientHome(p.UUID, p.ControllingClient)) 529 if (!Scene.TeleportClientHome(p.UUID, p.ControllingClient))
526 { 530 {
527 p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out."); 531 p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
528 p.ControllingClient.Close(); 532 p.ControllingClient.Close();
@@ -531,6 +535,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
531 } 535 }
532 }); 536 });
533 } 537 }
538
534 private void AbortTerrainXferHandler(IClientAPI remoteClient, ulong XferID) 539 private void AbortTerrainXferHandler(IClientAPI remoteClient, ulong XferID)
535 { 540 {
536 if (TerrainUploader != null) 541 if (TerrainUploader != null)
@@ -561,11 +566,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
561 TerrainUploader = null; 566 TerrainUploader = null;
562 } 567 }
563 remoteClient.SendAlertMessage("Terrain Upload Complete. Loading...."); 568 remoteClient.SendAlertMessage("Terrain Upload Complete. Loading....");
564 ITerrainModule terr = m_scene.RequestModuleInterface<ITerrainModule>(); 569 ITerrainModule terr = Scene.RequestModuleInterface<ITerrainModule>();
565 570
566 if (terr != null) 571 if (terr != null)
567 { 572 {
568 m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName); 573 m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + Scene.RegionInfo.RegionName);
569 574
570 try 575 try
571 { 576 {
@@ -611,7 +616,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
611 616
612 private void handleUploadTerrain(IClientAPI remote_client, string clientFileName) 617 private void handleUploadTerrain(IClientAPI remote_client, string clientFileName)
613 { 618 {
614
615 if (TerrainUploader == null) 619 if (TerrainUploader == null)
616 { 620 {
617 621
@@ -629,16 +633,16 @@ namespace OpenSim.Region.CoreModules.World.Estate
629 { 633 {
630 remote_client.SendAlertMessage("Another Terrain Upload is in progress. Please wait your turn!"); 634 remote_client.SendAlertMessage("Another Terrain Upload is in progress. Please wait your turn!");
631 } 635 }
632
633 } 636 }
637
634 private void handleTerrainRequest(IClientAPI remote_client, string clientFileName) 638 private void handleTerrainRequest(IClientAPI remote_client, string clientFileName)
635 { 639 {
636 // Save terrain here 640 // Save terrain here
637 ITerrainModule terr = m_scene.RequestModuleInterface<ITerrainModule>(); 641 ITerrainModule terr = Scene.RequestModuleInterface<ITerrainModule>();
638 642
639 if (terr != null) 643 if (terr != null)
640 { 644 {
641 m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName); 645 m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + Scene.RegionInfo.RegionName);
642 if (File.Exists(Util.dataDir() + "/terrain.raw")) 646 if (File.Exists(Util.dataDir() + "/terrain.raw"))
643 { 647 {
644 File.Delete(Util.dataDir() + "/terrain.raw"); 648 File.Delete(Util.dataDir() + "/terrain.raw");
@@ -649,7 +653,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
649 byte[] bdata = new byte[input.Length]; 653 byte[] bdata = new byte[input.Length];
650 input.Read(bdata, 0, (int)input.Length); 654 input.Read(bdata, 0, (int)input.Length);
651 remote_client.SendAlertMessage("Terrain file written, starting download..."); 655 remote_client.SendAlertMessage("Terrain file written, starting download...");
652 m_scene.XferManager.AddNewFile("terrain.raw", bdata); 656 Scene.XferManager.AddNewFile("terrain.raw", bdata);
653 // Tell client about it 657 // Tell client about it
654 m_log.Warn("[CLIENT]: Sending Terrain to " + remote_client.Name); 658 m_log.Warn("[CLIENT]: Sending Terrain to " + remote_client.Name);
655 remote_client.SendInitiateDownload("terrain.raw", clientFileName); 659 remote_client.SendInitiateDownload("terrain.raw", clientFileName);
@@ -659,35 +663,35 @@ namespace OpenSim.Region.CoreModules.World.Estate
659 private void HandleRegionInfoRequest(IClientAPI remote_client) 663 private void HandleRegionInfoRequest(IClientAPI remote_client)
660 { 664 {
661 RegionInfoForEstateMenuArgs args = new RegionInfoForEstateMenuArgs(); 665 RegionInfoForEstateMenuArgs args = new RegionInfoForEstateMenuArgs();
662 args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; 666 args.billableFactor = Scene.RegionInfo.EstateSettings.BillableFactor;
663 args.estateID = m_scene.RegionInfo.EstateSettings.EstateID; 667 args.estateID = Scene.RegionInfo.EstateSettings.EstateID;
664 args.maxAgents = (byte)m_scene.RegionInfo.RegionSettings.AgentLimit; 668 args.maxAgents = (byte)Scene.RegionInfo.RegionSettings.AgentLimit;
665 args.objectBonusFactor = (float)m_scene.RegionInfo.RegionSettings.ObjectBonus; 669 args.objectBonusFactor = (float)Scene.RegionInfo.RegionSettings.ObjectBonus;
666 args.parentEstateID = m_scene.RegionInfo.EstateSettings.ParentEstateID; 670 args.parentEstateID = Scene.RegionInfo.EstateSettings.ParentEstateID;
667 args.pricePerMeter = m_scene.RegionInfo.EstateSettings.PricePerMeter; 671 args.pricePerMeter = Scene.RegionInfo.EstateSettings.PricePerMeter;
668 args.redirectGridX = m_scene.RegionInfo.EstateSettings.RedirectGridX; 672 args.redirectGridX = Scene.RegionInfo.EstateSettings.RedirectGridX;
669 args.redirectGridY = m_scene.RegionInfo.EstateSettings.RedirectGridY; 673 args.redirectGridY = Scene.RegionInfo.EstateSettings.RedirectGridY;
670 args.regionFlags = GetRegionFlags(); 674 args.regionFlags = GetRegionFlags();
671 args.simAccess = m_scene.RegionInfo.AccessLevel; 675 args.simAccess = Scene.RegionInfo.AccessLevel;
672 args.sunHour = (float)m_scene.RegionInfo.RegionSettings.SunPosition; 676 args.sunHour = (float)Scene.RegionInfo.RegionSettings.SunPosition;
673 args.terrainLowerLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit; 677 args.terrainLowerLimit = (float)Scene.RegionInfo.RegionSettings.TerrainLowerLimit;
674 args.terrainRaiseLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit; 678 args.terrainRaiseLimit = (float)Scene.RegionInfo.RegionSettings.TerrainRaiseLimit;
675 args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; 679 args.useEstateSun = Scene.RegionInfo.RegionSettings.UseEstateSun;
676 args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; 680 args.waterHeight = (float)Scene.RegionInfo.RegionSettings.WaterHeight;
677 args.simName = m_scene.RegionInfo.RegionName; 681 args.simName = Scene.RegionInfo.RegionName;
678 args.regionType = m_scene.RegionInfo.RegionType; 682 args.regionType = Scene.RegionInfo.RegionType;
679 683
680 remote_client.SendRegionInfoToEstateMenu(args); 684 remote_client.SendRegionInfoToEstateMenu(args);
681 } 685 }
682 686
683 private void HandleEstateCovenantRequest(IClientAPI remote_client) 687 private void HandleEstateCovenantRequest(IClientAPI remote_client)
684 { 688 {
685 remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant); 689 remote_client.SendEstateCovenantInformation(Scene.RegionInfo.RegionSettings.Covenant);
686 } 690 }
687 691
688 private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) 692 private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient)
689 { 693 {
690 if (!m_scene.Permissions.CanIssueEstateCommand(remoteClient.AgentId, false)) 694 if (!Scene.Permissions.CanIssueEstateCommand(remoteClient.AgentId, false))
691 return; 695 return;
692 696
693 Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); 697 Dictionary<uint, float> SceneData = new Dictionary<uint,float>();
@@ -695,11 +699,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
695 699
696 if (reportType == 1) 700 if (reportType == 1)
697 { 701 {
698 SceneData = m_scene.PhysicsScene.GetTopColliders(); 702 SceneData = Scene.PhysicsScene.GetTopColliders();
699 } 703 }
700 else if (reportType == 0) 704 else if (reportType == 0)
701 { 705 {
702 SceneData = m_scene.SceneGraph.GetTopScripts(); 706 SceneData = Scene.SceneGraph.GetTopScripts();
703 } 707 }
704 708
705 List<LandStatReportItem> SceneReport = new List<LandStatReportItem>(); 709 List<LandStatReportItem> SceneReport = new List<LandStatReportItem>();
@@ -707,7 +711,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
707 { 711 {
708 foreach (uint obj in SceneData.Keys) 712 foreach (uint obj in SceneData.Keys)
709 { 713 {
710 SceneObjectPart prt = m_scene.GetSceneObjectPart(obj); 714 SceneObjectPart prt = Scene.GetSceneObjectPart(obj);
711 if (prt != null) 715 if (prt != null)
712 { 716 {
713 if (prt.ParentGroup != null) 717 if (prt.ParentGroup != null)
@@ -779,7 +783,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
779 { 783 {
780 // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]); 784 // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]);
781 785
782 IUserManagement userManager = m_scene.RequestModuleInterface<IUserManagement>(); 786 IUserManagement userManager = Scene.RequestModuleInterface<IUserManagement>();
783 if (userManager != null) 787 if (userManager != null)
784 userManager.GetUserName(uuidarr[i]); 788 userManager.GetUserName(uuidarr[i]);
785 789
@@ -794,7 +798,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
794 798
795 public void sendRegionInfoPacketToAll() 799 public void sendRegionInfoPacketToAll()
796 { 800 {
797 m_scene.ForEachScenePresence(delegate(ScenePresence sp) 801 Scene.ForEachScenePresence(delegate(ScenePresence sp)
798 { 802 {
799 if (!sp.IsChildAgent) 803 if (!sp.IsChildAgent)
800 HandleRegionInfoRequest(sp.ControllingClient); 804 HandleRegionInfoRequest(sp.ControllingClient);
@@ -805,99 +809,99 @@ namespace OpenSim.Region.CoreModules.World.Estate
805 { 809 {
806 RegionHandshakeArgs args = new RegionHandshakeArgs(); 810 RegionHandshakeArgs args = new RegionHandshakeArgs();
807 811
808 args.isEstateManager = m_scene.RegionInfo.EstateSettings.IsEstateManager(remoteClient.AgentId); 812 args.isEstateManager = Scene.RegionInfo.EstateSettings.IsEstateManager(remoteClient.AgentId);
809 if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero && m_scene.RegionInfo.EstateSettings.EstateOwner == remoteClient.AgentId) 813 if (Scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero && Scene.RegionInfo.EstateSettings.EstateOwner == remoteClient.AgentId)
810 args.isEstateManager = true; 814 args.isEstateManager = true;
811 815
812 args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; 816 args.billableFactor = Scene.RegionInfo.EstateSettings.BillableFactor;
813 args.terrainStartHeight0 = (float)m_scene.RegionInfo.RegionSettings.Elevation1SW; 817 args.terrainStartHeight0 = (float)Scene.RegionInfo.RegionSettings.Elevation1SW;
814 args.terrainHeightRange0 = (float)m_scene.RegionInfo.RegionSettings.Elevation2SW; 818 args.terrainHeightRange0 = (float)Scene.RegionInfo.RegionSettings.Elevation2SW;
815 args.terrainStartHeight1 = (float)m_scene.RegionInfo.RegionSettings.Elevation1NW; 819 args.terrainStartHeight1 = (float)Scene.RegionInfo.RegionSettings.Elevation1NW;
816 args.terrainHeightRange1 = (float)m_scene.RegionInfo.RegionSettings.Elevation2NW; 820 args.terrainHeightRange1 = (float)Scene.RegionInfo.RegionSettings.Elevation2NW;
817 args.terrainStartHeight2 = (float)m_scene.RegionInfo.RegionSettings.Elevation1SE; 821 args.terrainStartHeight2 = (float)Scene.RegionInfo.RegionSettings.Elevation1SE;
818 args.terrainHeightRange2 = (float)m_scene.RegionInfo.RegionSettings.Elevation2SE; 822 args.terrainHeightRange2 = (float)Scene.RegionInfo.RegionSettings.Elevation2SE;
819 args.terrainStartHeight3 = (float)m_scene.RegionInfo.RegionSettings.Elevation1NE; 823 args.terrainStartHeight3 = (float)Scene.RegionInfo.RegionSettings.Elevation1NE;
820 args.terrainHeightRange3 = (float)m_scene.RegionInfo.RegionSettings.Elevation2NE; 824 args.terrainHeightRange3 = (float)Scene.RegionInfo.RegionSettings.Elevation2NE;
821 args.simAccess = m_scene.RegionInfo.AccessLevel; 825 args.simAccess = Scene.RegionInfo.AccessLevel;
822 args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; 826 args.waterHeight = (float)Scene.RegionInfo.RegionSettings.WaterHeight;
823 args.regionFlags = GetRegionFlags(); 827 args.regionFlags = GetRegionFlags();
824 args.regionName = m_scene.RegionInfo.RegionName; 828 args.regionName = Scene.RegionInfo.RegionName;
825 args.SimOwner = m_scene.RegionInfo.EstateSettings.EstateOwner; 829 args.SimOwner = Scene.RegionInfo.EstateSettings.EstateOwner;
826 830
827 args.terrainBase0 = UUID.Zero; 831 args.terrainBase0 = UUID.Zero;
828 args.terrainBase1 = UUID.Zero; 832 args.terrainBase1 = UUID.Zero;
829 args.terrainBase2 = UUID.Zero; 833 args.terrainBase2 = UUID.Zero;
830 args.terrainBase3 = UUID.Zero; 834 args.terrainBase3 = UUID.Zero;
831 args.terrainDetail0 = m_scene.RegionInfo.RegionSettings.TerrainTexture1; 835 args.terrainDetail0 = Scene.RegionInfo.RegionSettings.TerrainTexture1;
832 args.terrainDetail1 = m_scene.RegionInfo.RegionSettings.TerrainTexture2; 836 args.terrainDetail1 = Scene.RegionInfo.RegionSettings.TerrainTexture2;
833 args.terrainDetail2 = m_scene.RegionInfo.RegionSettings.TerrainTexture3; 837 args.terrainDetail2 = Scene.RegionInfo.RegionSettings.TerrainTexture3;
834 args.terrainDetail3 = m_scene.RegionInfo.RegionSettings.TerrainTexture4; 838 args.terrainDetail3 = Scene.RegionInfo.RegionSettings.TerrainTexture4;
835 839
836 remoteClient.SendRegionHandshake(m_scene.RegionInfo,args); 840 remoteClient.SendRegionHandshake(Scene.RegionInfo,args);
837 } 841 }
838 842
839 public void sendRegionHandshakeToAll() 843 public void sendRegionHandshakeToAll()
840 { 844 {
841 m_scene.ForEachClient(sendRegionHandshake); 845 Scene.ForEachClient(sendRegionHandshake);
842 } 846 }
843 847
844 public void handleEstateChangeInfo(IClientAPI remoteClient, UUID invoice, UUID senderID, UInt32 parms1, UInt32 parms2) 848 public void handleEstateChangeInfo(IClientAPI remoteClient, UUID invoice, UUID senderID, UInt32 parms1, UInt32 parms2)
845 { 849 {
846 if (parms2 == 0) 850 if (parms2 == 0)
847 { 851 {
848 m_scene.RegionInfo.EstateSettings.UseGlobalTime = true; 852 Scene.RegionInfo.EstateSettings.UseGlobalTime = true;
849 m_scene.RegionInfo.EstateSettings.SunPosition = 0.0; 853 Scene.RegionInfo.EstateSettings.SunPosition = 0.0;
850 } 854 }
851 else 855 else
852 { 856 {
853 m_scene.RegionInfo.EstateSettings.UseGlobalTime = false; 857 Scene.RegionInfo.EstateSettings.UseGlobalTime = false;
854 m_scene.RegionInfo.EstateSettings.SunPosition = (parms2 - 0x1800)/1024.0; 858 Scene.RegionInfo.EstateSettings.SunPosition = (parms2 - 0x1800)/1024.0;
855 } 859 }
856 860
857 if ((parms1 & 0x00000010) != 0) 861 if ((parms1 & 0x00000010) != 0)
858 m_scene.RegionInfo.EstateSettings.FixedSun = true; 862 Scene.RegionInfo.EstateSettings.FixedSun = true;
859 else 863 else
860 m_scene.RegionInfo.EstateSettings.FixedSun = false; 864 Scene.RegionInfo.EstateSettings.FixedSun = false;
861 865
862 if ((parms1 & 0x00008000) != 0) 866 if ((parms1 & 0x00008000) != 0)
863 m_scene.RegionInfo.EstateSettings.PublicAccess = true; 867 Scene.RegionInfo.EstateSettings.PublicAccess = true;
864 else 868 else
865 m_scene.RegionInfo.EstateSettings.PublicAccess = false; 869 Scene.RegionInfo.EstateSettings.PublicAccess = false;
866 870
867 if ((parms1 & 0x10000000) != 0) 871 if ((parms1 & 0x10000000) != 0)
868 m_scene.RegionInfo.EstateSettings.AllowVoice = true; 872 Scene.RegionInfo.EstateSettings.AllowVoice = true;
869 else 873 else
870 m_scene.RegionInfo.EstateSettings.AllowVoice = false; 874 Scene.RegionInfo.EstateSettings.AllowVoice = false;
871 875
872 if ((parms1 & 0x00100000) != 0) 876 if ((parms1 & 0x00100000) != 0)
873 m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = true; 877 Scene.RegionInfo.EstateSettings.AllowDirectTeleport = true;
874 else 878 else
875 m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = false; 879 Scene.RegionInfo.EstateSettings.AllowDirectTeleport = false;
876 880
877 if ((parms1 & 0x00800000) != 0) 881 if ((parms1 & 0x00800000) != 0)
878 m_scene.RegionInfo.EstateSettings.DenyAnonymous = true; 882 Scene.RegionInfo.EstateSettings.DenyAnonymous = true;
879 else 883 else
880 m_scene.RegionInfo.EstateSettings.DenyAnonymous = false; 884 Scene.RegionInfo.EstateSettings.DenyAnonymous = false;
881 885
882 if ((parms1 & 0x01000000) != 0) 886 if ((parms1 & 0x01000000) != 0)
883 m_scene.RegionInfo.EstateSettings.DenyIdentified = true; 887 Scene.RegionInfo.EstateSettings.DenyIdentified = true;
884 else 888 else
885 m_scene.RegionInfo.EstateSettings.DenyIdentified = false; 889 Scene.RegionInfo.EstateSettings.DenyIdentified = false;
886 890
887 if ((parms1 & 0x02000000) != 0) 891 if ((parms1 & 0x02000000) != 0)
888 m_scene.RegionInfo.EstateSettings.DenyTransacted = true; 892 Scene.RegionInfo.EstateSettings.DenyTransacted = true;
889 else 893 else
890 m_scene.RegionInfo.EstateSettings.DenyTransacted = false; 894 Scene.RegionInfo.EstateSettings.DenyTransacted = false;
891 895
892 if ((parms1 & 0x40000000) != 0) 896 if ((parms1 & 0x40000000) != 0)
893 m_scene.RegionInfo.EstateSettings.DenyMinors = true; 897 Scene.RegionInfo.EstateSettings.DenyMinors = true;
894 else 898 else
895 m_scene.RegionInfo.EstateSettings.DenyMinors = false; 899 Scene.RegionInfo.EstateSettings.DenyMinors = false;
896 900
897 m_scene.RegionInfo.EstateSettings.Save(); 901 Scene.RegionInfo.EstateSettings.Save();
898 TriggerEstateInfoChange(); 902 TriggerEstateInfoChange();
899 903
900 m_scene.TriggerEstateSunUpdate(); 904 Scene.TriggerEstateSunUpdate();
901 905
902 sendDetailedEstateData(remoteClient, invoice); 906 sendDetailedEstateData(remoteClient, invoice);
903 } 907 }
@@ -907,124 +911,25 @@ namespace OpenSim.Region.CoreModules.World.Estate
907 #region IRegionModule Members 911 #region IRegionModule Members
908 912
909 public void Initialise(Scene scene, IConfigSource source) 913 public void Initialise(Scene scene, IConfigSource source)
910 { 914 {
911 m_scene = scene;
912 m_scene.RegisterModuleInterface<IEstateModule>(this);
913 m_scene.EventManager.OnNewClient += EventManager_OnNewClient;
914 m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
915 m_regionChangeTimer.AutoReset = false; 915 m_regionChangeTimer.AutoReset = false;
916 m_regionChangeTimer.Interval = 2000; 916 m_regionChangeTimer.Interval = 2000;
917 m_regionChangeTimer.Elapsed += RaiseRegionInfoChange; 917 m_regionChangeTimer.Elapsed += RaiseRegionInfoChange;
918 918
919 m_scene.AddCommand(this, "set terrain texture", 919 Scene = scene;
920 "set terrain texture <number> <uuid> [<x>] [<y>]", 920 Scene.RegisterModuleInterface<IEstateModule>(this);
921 "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " + 921 Scene.EventManager.OnNewClient += EventManager_OnNewClient;
922 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + 922 Scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
923 " that coordinate.", 923
924 consoleSetTerrainTexture); 924 m_commands = new EstateManagementCommands(this);
925 925 m_commands.Initialise();
926 m_scene.AddCommand(this, "set terrain heights",
927 "set terrain heights <corner> <min> <max> [<x>] [<y>]",
928 "Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " +
929 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
930 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.",
931 consoleSetTerrainHeights);
932 }
933
934 #region Console Commands
935
936 public void consoleSetTerrainTexture(string module, string[] args)
937 {
938 string num = args[3];
939 string uuid = args[4];
940 int x = (args.Length > 5 ? int.Parse(args[5]) : -1);
941 int y = (args.Length > 6 ? int.Parse(args[6]) : -1);
942
943 if (x == -1 || m_scene.RegionInfo.RegionLocX == x)
944 {
945 if (y == -1 || m_scene.RegionInfo.RegionLocY == y)
946 {
947 int corner = int.Parse(num);
948 UUID texture = UUID.Parse(uuid);
949
950 m_log.Debug("[ESTATEMODULE] Setting terrain textures for " + m_scene.RegionInfo.RegionName +
951 string.Format(" (C#{0} = {1})", corner, texture));
952
953 switch (corner)
954 {
955 case 0:
956 m_scene.RegionInfo.RegionSettings.TerrainTexture1 = texture;
957 break;
958 case 1:
959 m_scene.RegionInfo.RegionSettings.TerrainTexture2 = texture;
960 break;
961 case 2:
962 m_scene.RegionInfo.RegionSettings.TerrainTexture3 = texture;
963 break;
964 case 3:
965 m_scene.RegionInfo.RegionSettings.TerrainTexture4 = texture;
966 break;
967 }
968 m_scene.RegionInfo.RegionSettings.Save();
969 TriggerRegionInfoChange();
970 sendRegionInfoPacketToAll();
971
972 }
973 }
974 }
975
976 public void consoleSetTerrainHeights(string module, string[] args)
977 {
978 string num = args[3];
979 string min = args[4];
980 string max = args[5];
981 int x = (args.Length > 6 ? int.Parse(args[6]) : -1);
982 int y = (args.Length > 7 ? int.Parse(args[7]) : -1);
983
984 if (x == -1 || m_scene.RegionInfo.RegionLocX == x)
985 {
986 if (y == -1 || m_scene.RegionInfo.RegionLocY == y)
987 {
988 int corner = int.Parse(num);
989 float lowValue = float.Parse(min, Culture.NumberFormatInfo);
990 float highValue = float.Parse(max, Culture.NumberFormatInfo);
991
992 m_log.Debug("[ESTATEMODULE] Setting terrain heights " + m_scene.RegionInfo.RegionName +
993 string.Format(" (C{0}, {1}-{2}", corner, lowValue, highValue));
994
995 switch (corner)
996 {
997 case 0:
998 m_scene.RegionInfo.RegionSettings.Elevation1SW = lowValue;
999 m_scene.RegionInfo.RegionSettings.Elevation2SW = highValue;
1000 break;
1001 case 1:
1002 m_scene.RegionInfo.RegionSettings.Elevation1NW = lowValue;
1003 m_scene.RegionInfo.RegionSettings.Elevation2NW = highValue;
1004 break;
1005 case 2:
1006 m_scene.RegionInfo.RegionSettings.Elevation1SE = lowValue;
1007 m_scene.RegionInfo.RegionSettings.Elevation2SE = highValue;
1008 break;
1009 case 3:
1010 m_scene.RegionInfo.RegionSettings.Elevation1NE = lowValue;
1011 m_scene.RegionInfo.RegionSettings.Elevation2NE = highValue;
1012 break;
1013 }
1014 m_scene.RegionInfo.RegionSettings.Save();
1015 TriggerRegionInfoChange();
1016 sendRegionHandshakeToAll();
1017 }
1018 }
1019 } 926 }
1020 927
1021 #endregion
1022
1023 public void PostInitialise() 928 public void PostInitialise()
1024 { 929 {
1025 // Sets up the sun module based no the saved Estate and Region Settings 930 // Sets up the sun module based no the saved Estate and Region Settings
1026 // DO NOT REMOVE or the sun will stop working 931 // DO NOT REMOVE or the sun will stop working
1027 m_scene.TriggerEstateSunUpdate(); 932 Scene.TriggerEstateSunUpdate();
1028 } 933 }
1029 934
1030 public void Close() 935 public void Close()
@@ -1048,14 +953,14 @@ namespace OpenSim.Region.CoreModules.World.Estate
1048 public void changeWaterHeight(float height) 953 public void changeWaterHeight(float height)
1049 { 954 {
1050 setRegionTerrainSettings(height, 955 setRegionTerrainSettings(height,
1051 (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit, 956 (float)Scene.RegionInfo.RegionSettings.TerrainRaiseLimit,
1052 (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit, 957 (float)Scene.RegionInfo.RegionSettings.TerrainLowerLimit,
1053 m_scene.RegionInfo.RegionSettings.UseEstateSun, 958 Scene.RegionInfo.RegionSettings.UseEstateSun,
1054 m_scene.RegionInfo.RegionSettings.FixedSun, 959 Scene.RegionInfo.RegionSettings.FixedSun,
1055 (float)m_scene.RegionInfo.RegionSettings.SunPosition, 960 (float)Scene.RegionInfo.RegionSettings.SunPosition,
1056 m_scene.RegionInfo.EstateSettings.UseGlobalTime, 961 Scene.RegionInfo.EstateSettings.UseGlobalTime,
1057 m_scene.RegionInfo.EstateSettings.FixedSun, 962 Scene.RegionInfo.EstateSettings.FixedSun,
1058 (float)m_scene.RegionInfo.EstateSettings.SunPosition); 963 (float)Scene.RegionInfo.EstateSettings.SunPosition);
1059 964
1060 sendRegionInfoPacketToAll(); 965 sendRegionInfoPacketToAll();
1061 } 966 }
@@ -1095,32 +1000,32 @@ namespace OpenSim.Region.CoreModules.World.Estate
1095 1000
1096 // Fully implemented 1001 // Fully implemented
1097 // 1002 //
1098 if (m_scene.RegionInfo.RegionSettings.AllowDamage) 1003 if (Scene.RegionInfo.RegionSettings.AllowDamage)
1099 flags |= RegionFlags.AllowDamage; 1004 flags |= RegionFlags.AllowDamage;
1100 if (m_scene.RegionInfo.RegionSettings.BlockTerraform) 1005 if (Scene.RegionInfo.RegionSettings.BlockTerraform)
1101 flags |= RegionFlags.BlockTerraform; 1006 flags |= RegionFlags.BlockTerraform;
1102 if (!m_scene.RegionInfo.RegionSettings.AllowLandResell) 1007 if (!Scene.RegionInfo.RegionSettings.AllowLandResell)
1103 flags |= RegionFlags.BlockLandResell; 1008 flags |= RegionFlags.BlockLandResell;
1104 if (m_scene.RegionInfo.RegionSettings.DisableCollisions) 1009 if (Scene.RegionInfo.RegionSettings.DisableCollisions)
1105 flags |= RegionFlags.SkipCollisions; 1010 flags |= RegionFlags.SkipCollisions;
1106 if (m_scene.RegionInfo.RegionSettings.DisableScripts) 1011 if (Scene.RegionInfo.RegionSettings.DisableScripts)
1107 flags |= RegionFlags.SkipScripts; 1012 flags |= RegionFlags.SkipScripts;
1108 if (m_scene.RegionInfo.RegionSettings.DisablePhysics) 1013 if (Scene.RegionInfo.RegionSettings.DisablePhysics)
1109 flags |= RegionFlags.SkipPhysics; 1014 flags |= RegionFlags.SkipPhysics;
1110 if (m_scene.RegionInfo.RegionSettings.BlockFly) 1015 if (Scene.RegionInfo.RegionSettings.BlockFly)
1111 flags |= RegionFlags.NoFly; 1016 flags |= RegionFlags.NoFly;
1112 if (m_scene.RegionInfo.RegionSettings.RestrictPushing) 1017 if (Scene.RegionInfo.RegionSettings.RestrictPushing)
1113 flags |= RegionFlags.RestrictPushObject; 1018 flags |= RegionFlags.RestrictPushObject;
1114 if (m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide) 1019 if (Scene.RegionInfo.RegionSettings.AllowLandJoinDivide)
1115 flags |= RegionFlags.AllowParcelChanges; 1020 flags |= RegionFlags.AllowParcelChanges;
1116 if (m_scene.RegionInfo.RegionSettings.BlockShowInSearch) 1021 if (Scene.RegionInfo.RegionSettings.BlockShowInSearch)
1117 flags |= RegionFlags.BlockParcelSearch; 1022 flags |= RegionFlags.BlockParcelSearch;
1118 1023
1119 if (m_scene.RegionInfo.RegionSettings.FixedSun) 1024 if (Scene.RegionInfo.RegionSettings.FixedSun)
1120 flags |= RegionFlags.SunFixed; 1025 flags |= RegionFlags.SunFixed;
1121 if (m_scene.RegionInfo.RegionSettings.Sandbox) 1026 if (Scene.RegionInfo.RegionSettings.Sandbox)
1122 flags |= RegionFlags.Sandbox; 1027 flags |= RegionFlags.Sandbox;
1123 if (m_scene.RegionInfo.EstateSettings.AllowVoice) 1028 if (Scene.RegionInfo.EstateSettings.AllowVoice)
1124 flags |= RegionFlags.AllowVoice; 1029 flags |= RegionFlags.AllowVoice;
1125 1030
1126 // Fudge these to always on, so the menu options activate 1031 // Fudge these to always on, so the menu options activate
@@ -1142,32 +1047,32 @@ namespace OpenSim.Region.CoreModules.World.Estate
1142 { 1047 {
1143 RegionFlags flags = RegionFlags.None; 1048 RegionFlags flags = RegionFlags.None;
1144 1049
1145 if (m_scene.RegionInfo.EstateSettings.FixedSun) 1050 if (Scene.RegionInfo.EstateSettings.FixedSun)
1146 flags |= RegionFlags.SunFixed; 1051 flags |= RegionFlags.SunFixed;
1147 if (m_scene.RegionInfo.EstateSettings.PublicAccess) 1052 if (Scene.RegionInfo.EstateSettings.PublicAccess)
1148 flags |= (RegionFlags.PublicAllowed | 1053 flags |= (RegionFlags.PublicAllowed |
1149 RegionFlags.ExternallyVisible); 1054 RegionFlags.ExternallyVisible);
1150 if (m_scene.RegionInfo.EstateSettings.AllowVoice) 1055 if (Scene.RegionInfo.EstateSettings.AllowVoice)
1151 flags |= RegionFlags.AllowVoice; 1056 flags |= RegionFlags.AllowVoice;
1152 if (m_scene.RegionInfo.EstateSettings.AllowDirectTeleport) 1057 if (Scene.RegionInfo.EstateSettings.AllowDirectTeleport)
1153 flags |= RegionFlags.AllowDirectTeleport; 1058 flags |= RegionFlags.AllowDirectTeleport;
1154 if (m_scene.RegionInfo.EstateSettings.DenyAnonymous) 1059 if (Scene.RegionInfo.EstateSettings.DenyAnonymous)
1155 flags |= RegionFlags.DenyAnonymous; 1060 flags |= RegionFlags.DenyAnonymous;
1156 if (m_scene.RegionInfo.EstateSettings.DenyIdentified) 1061 if (Scene.RegionInfo.EstateSettings.DenyIdentified)
1157 flags |= RegionFlags.DenyIdentified; 1062 flags |= RegionFlags.DenyIdentified;
1158 if (m_scene.RegionInfo.EstateSettings.DenyTransacted) 1063 if (Scene.RegionInfo.EstateSettings.DenyTransacted)
1159 flags |= RegionFlags.DenyTransacted; 1064 flags |= RegionFlags.DenyTransacted;
1160 if (m_scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner) 1065 if (Scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner)
1161 flags |= RegionFlags.AbuseEmailToEstateOwner; 1066 flags |= RegionFlags.AbuseEmailToEstateOwner;
1162 if (m_scene.RegionInfo.EstateSettings.BlockDwell) 1067 if (Scene.RegionInfo.EstateSettings.BlockDwell)
1163 flags |= RegionFlags.BlockDwell; 1068 flags |= RegionFlags.BlockDwell;
1164 if (m_scene.RegionInfo.EstateSettings.EstateSkipScripts) 1069 if (Scene.RegionInfo.EstateSettings.EstateSkipScripts)
1165 flags |= RegionFlags.EstateSkipScripts; 1070 flags |= RegionFlags.EstateSkipScripts;
1166 if (m_scene.RegionInfo.EstateSettings.ResetHomeOnTeleport) 1071 if (Scene.RegionInfo.EstateSettings.ResetHomeOnTeleport)
1167 flags |= RegionFlags.ResetHomeOnTeleport; 1072 flags |= RegionFlags.ResetHomeOnTeleport;
1168 if (m_scene.RegionInfo.EstateSettings.TaxFree) 1073 if (Scene.RegionInfo.EstateSettings.TaxFree)
1169 flags |= RegionFlags.TaxFree; 1074 flags |= RegionFlags.TaxFree;
1170 if (m_scene.RegionInfo.EstateSettings.DenyMinors) 1075 if (Scene.RegionInfo.EstateSettings.DenyMinors)
1171 flags |= (RegionFlags)(1 << 30); 1076 flags |= (RegionFlags)(1 << 30);
1172 1077
1173 return (uint)flags; 1078 return (uint)flags;
@@ -1175,17 +1080,17 @@ namespace OpenSim.Region.CoreModules.World.Estate
1175 1080
1176 public bool IsManager(UUID avatarID) 1081 public bool IsManager(UUID avatarID)
1177 { 1082 {
1178 if (avatarID == m_scene.RegionInfo.EstateSettings.EstateOwner) 1083 if (avatarID == Scene.RegionInfo.EstateSettings.EstateOwner)
1179 return true; 1084 return true;
1180 1085
1181 List<UUID> ems = new List<UUID>(m_scene.RegionInfo.EstateSettings.EstateManagers); 1086 List<UUID> ems = new List<UUID>(Scene.RegionInfo.EstateSettings.EstateManagers);
1182 if (ems.Contains(avatarID)) 1087 if (ems.Contains(avatarID))
1183 return true; 1088 return true;
1184 1089
1185 return false; 1090 return false;
1186 } 1091 }
1187 1092
1188 protected void TriggerRegionInfoChange() 1093 public void TriggerRegionInfoChange()
1189 { 1094 {
1190 m_regionChangeTimer.Stop(); 1095 m_regionChangeTimer.Stop();
1191 m_regionChangeTimer.Start(); 1096 m_regionChangeTimer.Start();
@@ -1196,23 +1101,23 @@ namespace OpenSim.Region.CoreModules.World.Estate
1196 ChangeDelegate change = OnRegionInfoChange; 1101 ChangeDelegate change = OnRegionInfoChange;
1197 1102
1198 if (change != null) 1103 if (change != null)
1199 change(m_scene.RegionInfo.RegionID); 1104 change(Scene.RegionInfo.RegionID);
1200 } 1105 }
1201 1106
1202 protected void TriggerEstateInfoChange() 1107 public void TriggerEstateInfoChange()
1203 { 1108 {
1204 ChangeDelegate change = OnEstateInfoChange; 1109 ChangeDelegate change = OnEstateInfoChange;
1205 1110
1206 if (change != null) 1111 if (change != null)
1207 change(m_scene.RegionInfo.RegionID); 1112 change(Scene.RegionInfo.RegionID);
1208 } 1113 }
1209 1114
1210 protected void TriggerEstateMessage(UUID fromID, string fromName, string message) 1115 public void TriggerEstateMessage(UUID fromID, string fromName, string message)
1211 { 1116 {
1212 MessageDelegate onmessage = OnEstateMessage; 1117 MessageDelegate onmessage = OnEstateMessage;
1213 1118
1214 if (onmessage != null) 1119 if (onmessage != null)
1215 onmessage(m_scene.RegionInfo.RegionID, fromID, fromName, message); 1120 onmessage(Scene.RegionInfo.RegionID, fromID, fromName, message);
1216 } 1121 }
1217 } 1122 }
1218} 1123}
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index e0f36a2..1094970 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -764,10 +764,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
764 764
765 if (!responseMap.ContainsKey(itemtype.ToString())) // remote sim doesnt have the stated region handle 765 if (!responseMap.ContainsKey(itemtype.ToString())) // remote sim doesnt have the stated region handle
766 { 766 {
767 if (!m_blacklistedregions.ContainsKey(regionhandle)) 767 m_log.DebugFormat("[WORLD MAP]: Remote sim does not have the stated region. Blacklisting.");
768 lock (m_blacklistedregions)
768 { 769 {
769 m_log.DebugFormat("[WORLD MAP]: Remote sim does not have the stated region. Blacklisting."); 770 if (!m_blacklistedregions.ContainsKey(regionhandle))
770 m_blacklistedregions.Add(regionhandle, Environment.TickCount); 771 m_blacklistedregions.Add(regionhandle, Environment.TickCount);
771 } 772 }
772 } 773 }
773 774
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 2424194..171d637 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -64,6 +64,8 @@ namespace OpenSim.Region.Framework.Scenes
64 64
65 #region Fields 65 #region Fields
66 66
67 public bool EmergencyMonitoring = false;
68
67 public SynchronizeSceneHandler SynchronizeScene; 69 public SynchronizeSceneHandler SynchronizeScene;
68 public SimStatsReporter StatsReporter; 70 public SimStatsReporter StatsReporter;
69 public List<Border> NorthBorders = new List<Border>(); 71 public List<Border> NorthBorders = new List<Border>();
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
index 6630edb..dfeecb1 100644
--- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
@@ -95,7 +95,15 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
95 "Show throttle settings for each client and for the server overall", 95 "Show throttle settings for each client and for the server overall",
96 "Without the 'full' option, only root agents are shown." 96 "Without the 'full' option, only root agents are shown."
97 + " With the 'full' option child agents are also shown.", 97 + " With the 'full' option child agents are also shown.",
98 ShowThrottlesReport); 98 ShowThrottlesReport);
99
100 scene.AddCommand(
101 this, "emergency-monitoring",
102 "Go on/off emergency monitoring mode",
103 "Go on/off emergency monitoring mode",
104 "Go on/off emergency monitoring mode",
105 EmergencyMonitoring);
106
99 } 107 }
100 108
101 public void RemoveRegion(Scene scene) 109 public void RemoveRegion(Scene scene)
@@ -120,7 +128,25 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
120 { 128 {
121 MainConsole.Instance.Output(GetThrottlesReport(cmd)); 129 MainConsole.Instance.Output(GetThrottlesReport(cmd));
122 } 130 }
123 131
132 protected void EmergencyMonitoring(string module, string[] cmd)
133 {
134 bool mode = true;
135 if (cmd.Length == 1 || (cmd.Length > 1 && cmd[1] == "on"))
136 {
137 mode = true;
138 MainConsole.Instance.Output("Emergency Monitoring ON");
139 }
140 else
141 {
142 mode = false;
143 MainConsole.Instance.Output("Emergency Monitoring OFF");
144 }
145
146 foreach (Scene s in m_scenes.Values)
147 s.EmergencyMonitoring = mode;
148 }
149
124 protected string GetColumnEntry(string entry, int maxLength, int columnPadding) 150 protected string GetColumnEntry(string entry, int maxLength, int columnPadding)
125 { 151 {
126 return string.Format( 152 return string.Format(
@@ -335,7 +361,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
335 ThrottleRates throttleRates = udpServer.ThrottleRates; 361 ThrottleRates throttleRates = udpServer.ThrottleRates;
336 report.AppendFormat( 362 report.AppendFormat(
337 "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}", 363 "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}",
338 "n/a", 364 (throttleRates.Total * 8) / 1000,
339 (throttleRates.ResendLimit * 8) / 1000, 365 (throttleRates.ResendLimit * 8) / 1000,
340 (throttleRates.LandLimit * 8) / 1000, 366 (throttleRates.LandLimit * 8) / 1000,
341 (throttleRates.WindLimit * 8) / 1000, 367 (throttleRates.WindLimit * 8) / 1000,