aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs29
-rw-r--r--OpenSim/Region/CoreModules/World/Region/RestartModule.cs83
4 files changed, 94 insertions, 33 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index ddc2a07..fdef9d8 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -61,6 +61,8 @@ namespace OpenSim.Region.CoreModules.World.Estate
61 public event ChangeDelegate OnEstateInfoChange; 61 public event ChangeDelegate OnEstateInfoChange;
62 public event MessageDelegate OnEstateMessage; 62 public event MessageDelegate OnEstateMessage;
63 63
64 private int m_delayCount = 0;
65
64 #region Packet Data Responders 66 #region Packet Data Responders
65 67
66 private void clientSendDetailedEstateData(IClientAPI remote_client, UUID invoice) 68 private void clientSendDetailedEstateData(IClientAPI remote_client, UUID invoice)
@@ -270,7 +272,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
270 { 272 {
271 if (timeInSeconds == -1) 273 if (timeInSeconds == -1)
272 { 274 {
273 restartModule.AbortRestart("Restart aborted by region manager"); 275 m_delayCount++;
276 if (m_delayCount > 3)
277 return;
278
279 restartModule.DelayRestart(3600, "Restart delayed by region manager");
274 return; 280 return;
275 } 281 }
276 282
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 2fa0b3f..51dcb67 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -1101,8 +1101,11 @@ namespace OpenSim.Region.CoreModules.World.Land
1101 { 1101 {
1102 if (!temp.Contains(currentParcel)) 1102 if (!temp.Contains(currentParcel))
1103 { 1103 {
1104 currentParcel.ForceUpdateLandInfo(); 1104 if (!currentParcel.IsEitherBannedOrRestricted(remote_client.AgentId))
1105 temp.Add(currentParcel); 1105 {
1106 currentParcel.ForceUpdateLandInfo();
1107 temp.Add(currentParcel);
1108 }
1106 } 1109 }
1107 } 1110 }
1108 } 1111 }
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 16792b3..f32e4d8 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -50,6 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Land
50 private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax]; 50 private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax];
51 51
52 private int m_lastSeqId = 0; 52 private int m_lastSeqId = 0;
53 private int m_expiryCounter = 0;
53 54
54 protected LandData m_landData = new LandData(); 55 protected LandData m_landData = new LandData();
55 protected Scene m_scene; 56 protected Scene m_scene;
@@ -135,6 +136,8 @@ namespace OpenSim.Region.CoreModules.World.Land
135 else 136 else
136 LandData.GroupID = UUID.Zero; 137 LandData.GroupID = UUID.Zero;
137 LandData.IsGroupOwned = is_group_owned; 138 LandData.IsGroupOwned = is_group_owned;
139
140 m_scene.EventManager.OnFrame += OnFrame;
138 } 141 }
139 142
140 #endregion 143 #endregion
@@ -1199,6 +1202,17 @@ namespace OpenSim.Region.CoreModules.World.Land
1199 1202
1200 #endregion 1203 #endregion
1201 1204
1205 private void OnFrame()
1206 {
1207 m_expiryCounter++;
1208
1209 if (m_expiryCounter >= 50)
1210 {
1211 ExpireAccessList();
1212 m_expiryCounter = 0;
1213 }
1214 }
1215
1202 private void ExpireAccessList() 1216 private void ExpireAccessList()
1203 { 1217 {
1204 List<LandAccessEntry> delete = new List<LandAccessEntry>(); 1218 List<LandAccessEntry> delete = new List<LandAccessEntry>();
@@ -1209,7 +1223,22 @@ namespace OpenSim.Region.CoreModules.World.Land
1209 delete.Add(entry); 1223 delete.Add(entry);
1210 } 1224 }
1211 foreach (LandAccessEntry entry in delete) 1225 foreach (LandAccessEntry entry in delete)
1226 {
1212 LandData.ParcelAccessList.Remove(entry); 1227 LandData.ParcelAccessList.Remove(entry);
1228 ScenePresence presence;
1229
1230 if (m_scene.TryGetScenePresence(entry.AgentID, out presence) && (!presence.IsChildAgent))
1231 {
1232 ILandObject land = m_scene.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
1233 if (land.LandData.LocalID == LandData.LocalID)
1234 {
1235 Vector3 pos = m_scene.GetNearestAllowedPosition(presence, land);
1236 presence.TeleportWithMomentum(pos);
1237 presence.ControllingClient.SendAlertMessage("You have been ejected from this land");
1238 }
1239 }
1240 m_log.DebugFormat("[LAND]: Removing entry {0} because it has expired", entry.AgentID);
1241 }
1213 1242
1214 if (delete.Count > 0) 1243 if (delete.Count > 0)
1215 m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this); 1244 m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this);
diff --git a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs
index 65180b5a..287738a 100644
--- a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs
+++ b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs
@@ -59,6 +59,7 @@ namespace OpenSim.Region.CoreModules.World.Region
59 protected bool m_Notice = false; 59 protected bool m_Notice = false;
60 protected IDialogModule m_DialogModule = null; 60 protected IDialogModule m_DialogModule = null;
61 protected string m_MarkerPath = String.Empty; 61 protected string m_MarkerPath = String.Empty;
62 private int[] m_CurrentAlerts = null;
62 63
63 public void Initialise(IConfigSource config) 64 public void Initialise(IConfigSource config)
64 { 65 {
@@ -141,6 +142,7 @@ namespace OpenSim.Region.CoreModules.World.Region
141 m_Message = message; 142 m_Message = message;
142 m_Initiator = initiator; 143 m_Initiator = initiator;
143 m_Notice = notice; 144 m_Notice = notice;
145 m_CurrentAlerts = alerts;
144 m_Alerts = new List<int>(alerts); 146 m_Alerts = new List<int>(alerts);
145 m_Alerts.Sort(); 147 m_Alerts.Sort();
146 m_Alerts.Reverse(); 148 m_Alerts.Reverse();
@@ -152,12 +154,12 @@ namespace OpenSim.Region.CoreModules.World.Region
152 return; 154 return;
153 } 155 }
154 156
155 int nextInterval = DoOneNotice(); 157 int nextInterval = DoOneNotice(true);
156 158
157 SetTimer(nextInterval); 159 SetTimer(nextInterval);
158 } 160 }
159 161
160 public int DoOneNotice() 162 public int DoOneNotice(bool sendOut)
161 { 163 {
162 if (m_Alerts.Count == 0 || m_Alerts[0] == 0) 164 if (m_Alerts.Count == 0 || m_Alerts[0] == 0)
163 { 165 {
@@ -182,34 +184,37 @@ namespace OpenSim.Region.CoreModules.World.Region
182 184
183 m_Alerts.RemoveAt(0); 185 m_Alerts.RemoveAt(0);
184 186
185 int minutes = currentAlert / 60; 187 if (sendOut)
186 string currentAlertString = String.Empty;
187 if (minutes > 0)
188 { 188 {
189 if (minutes == 1) 189 int minutes = currentAlert / 60;
190 currentAlertString += "1 minute"; 190 string currentAlertString = String.Empty;
191 else 191 if (minutes > 0)
192 currentAlertString += String.Format("{0} minutes", minutes); 192 {
193 if (minutes == 1)
194 currentAlertString += "1 minute";
195 else
196 currentAlertString += String.Format("{0} minutes", minutes);
197 if ((currentAlert % 60) != 0)
198 currentAlertString += " and ";
199 }
193 if ((currentAlert % 60) != 0) 200 if ((currentAlert % 60) != 0)
194 currentAlertString += " and "; 201 {
195 } 202 int seconds = currentAlert % 60;
196 if ((currentAlert % 60) != 0) 203 if (seconds == 1)
197 { 204 currentAlertString += "1 second";
198 int seconds = currentAlert % 60; 205 else
199 if (seconds == 1) 206 currentAlertString += String.Format("{0} seconds", seconds);
200 currentAlertString += "1 second"; 207 }
201 else
202 currentAlertString += String.Format("{0} seconds", seconds);
203 }
204 208
205 string msg = String.Format(m_Message, currentAlertString); 209 string msg = String.Format(m_Message, currentAlertString);
206 210
207 if (m_DialogModule != null && msg != String.Empty) 211 if (m_DialogModule != null && msg != String.Empty)
208 { 212 {
209 if (m_Notice) 213 if (m_Notice)
210 m_DialogModule.SendGeneralAlert(msg); 214 m_DialogModule.SendGeneralAlert(msg);
211 else 215 else
212 m_DialogModule.SendNotificationToUsersInRegion(m_Initiator, "System", msg); 216 m_DialogModule.SendNotificationToUsersInRegion(m_Initiator, "System", msg);
217 }
213 } 218 }
214 219
215 return currentAlert - nextAlert; 220 return currentAlert - nextAlert;
@@ -226,7 +231,25 @@ namespace OpenSim.Region.CoreModules.World.Region
226 231
227 private void OnTimer(object source, ElapsedEventArgs e) 232 private void OnTimer(object source, ElapsedEventArgs e)
228 { 233 {
229 int nextInterval = DoOneNotice(); 234 int nextInterval = DoOneNotice(true);
235
236 SetTimer(nextInterval);
237 }
238
239 public void DelayRestart(int seconds, string message)
240 {
241 if (m_CountdownTimer == null)
242 return;
243
244 m_CountdownTimer.Stop();
245 m_CountdownTimer = null;
246
247 m_Alerts = new List<int>(m_CurrentAlerts);
248 m_Alerts.Add(seconds);
249 m_Alerts.Sort();
250 m_Alerts.Reverse();
251
252 int nextInterval = DoOneNotice(false);
230 253
231 SetTimer(nextInterval); 254 SetTimer(nextInterval);
232 } 255 }
@@ -240,9 +263,9 @@ namespace OpenSim.Region.CoreModules.World.Region
240 if (m_DialogModule != null && message != String.Empty) 263 if (m_DialogModule != null && message != String.Empty)
241 m_DialogModule.SendGeneralAlert(message); 264 m_DialogModule.SendGeneralAlert(message);
242 } 265 }
243 if (m_MarkerPath != String.Empty) 266 if (m_MarkerPath != String.Empty)
244 File.Delete(Path.Combine(m_MarkerPath, 267 File.Delete(Path.Combine(m_MarkerPath,
245 m_Scene.RegionInfo.RegionID.ToString())); 268 m_Scene.RegionInfo.RegionID.ToString()));
246 } 269 }
247 270
248 private void HandleRegionRestart(string module, string[] args) 271 private void HandleRegionRestart(string module, string[] args)