diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
5 files changed, 76 insertions, 31 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 2d46276..41958b3 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | |||
@@ -40,6 +40,13 @@ using OpenSim.Region.Framework.Scenes; | |||
40 | 40 | ||
41 | namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | 41 | namespace OpenSim.Region.CoreModules.Avatar.InstantMessage |
42 | { | 42 | { |
43 | public struct SendReply | ||
44 | { | ||
45 | public bool Success; | ||
46 | public string Message; | ||
47 | public int Disposition; | ||
48 | } | ||
49 | |||
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "OfflineMessageModule")] | 50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "OfflineMessageModule")] |
44 | public class OfflineMessageModule : ISharedRegionModule | 51 | public class OfflineMessageModule : ISharedRegionModule |
45 | { | 52 | { |
@@ -50,6 +57,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
50 | private string m_RestURL = String.Empty; | 57 | private string m_RestURL = String.Empty; |
51 | IMessageTransferModule m_TransferModule = null; | 58 | IMessageTransferModule m_TransferModule = null; |
52 | private bool m_ForwardOfflineGroupMessages = true; | 59 | private bool m_ForwardOfflineGroupMessages = true; |
60 | private Dictionary<IClientAPI, List<UUID>> m_repliesSent= new Dictionary<IClientAPI, List<UUID>>(); | ||
53 | 61 | ||
54 | public void Initialise(IConfigSource config) | 62 | public void Initialise(IConfigSource config) |
55 | { | 63 | { |
@@ -169,6 +177,12 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
169 | private void OnNewClient(IClientAPI client) | 177 | private void OnNewClient(IClientAPI client) |
170 | { | 178 | { |
171 | client.OnRetrieveInstantMessages += RetrieveInstantMessages; | 179 | client.OnRetrieveInstantMessages += RetrieveInstantMessages; |
180 | client.OnLogout += OnClientLoggedOut; | ||
181 | } | ||
182 | |||
183 | public void OnClientLoggedOut(IClientAPI client) | ||
184 | { | ||
185 | m_repliesSent.Remove(client); | ||
172 | } | 186 | } |
173 | 187 | ||
174 | private void RetrieveInstantMessages(IClientAPI client) | 188 | private void RetrieveInstantMessages(IClientAPI client) |
@@ -228,7 +242,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
228 | if (scene == null) | 242 | if (scene == null) |
229 | scene = m_SceneList[0]; | 243 | scene = m_SceneList[0]; |
230 | 244 | ||
231 | bool success = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>( | 245 | SendReply reply = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, SendReply>( |
232 | "POST", m_RestURL+"/SaveMessage/?scope=" + | 246 | "POST", m_RestURL+"/SaveMessage/?scope=" + |
233 | scene.RegionInfo.ScopeID.ToString(), im); | 247 | scene.RegionInfo.ScopeID.ToString(), im); |
234 | 248 | ||
@@ -238,13 +252,38 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
238 | if (client == null) | 252 | if (client == null) |
239 | return; | 253 | return; |
240 | 254 | ||
241 | client.SendInstantMessage(new GridInstantMessage( | 255 | if (reply.Message == String.Empty) |
242 | null, new UUID(im.toAgentID), | 256 | reply.Message = "User is not logged in. " + (reply.Success ? "Message saved." : "Message not saved"); |
243 | "System", new UUID(im.fromAgentID), | 257 | |
244 | (byte)InstantMessageDialog.MessageFromAgent, | 258 | bool sendReply = true; |
245 | "User is not logged in. "+ | 259 | |
246 | (success ? "Message saved." : "Message not saved"), | 260 | switch (reply.Disposition) |
247 | false, new Vector3())); | 261 | { |
262 | case 0: // Normal | ||
263 | break; | ||
264 | case 1: // Only once per user | ||
265 | if (m_repliesSent.ContainsKey(client) && m_repliesSent[client].Contains(new UUID(im.toAgentID))) | ||
266 | { | ||
267 | sendReply = false; | ||
268 | } | ||
269 | else | ||
270 | { | ||
271 | if (!m_repliesSent.ContainsKey(client)) | ||
272 | m_repliesSent[client] = new List<UUID>(); | ||
273 | m_repliesSent[client].Add(new UUID(im.toAgentID)); | ||
274 | } | ||
275 | break; | ||
276 | } | ||
277 | |||
278 | if (sendReply) | ||
279 | { | ||
280 | client.SendInstantMessage(new GridInstantMessage( | ||
281 | null, new UUID(im.toAgentID), | ||
282 | "System", new UUID(im.fromAgentID), | ||
283 | (byte)InstantMessageDialog.MessageFromAgent, | ||
284 | reply.Message, | ||
285 | false, new Vector3())); | ||
286 | } | ||
248 | } | 287 | } |
249 | } | 288 | } |
250 | } | 289 | } |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 7aa1ced..47390e7 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -96,6 +96,10 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
96 | 96 | ||
97 | m_commands = new EstateManagementCommands(this); | 97 | m_commands = new EstateManagementCommands(this); |
98 | m_commands.Initialise(); | 98 | m_commands.Initialise(); |
99 | |||
100 | m_regionChangeTimer.Interval = 10000; | ||
101 | m_regionChangeTimer.Elapsed += RaiseRegionInfoChange; | ||
102 | m_regionChangeTimer.AutoReset = false; | ||
99 | } | 103 | } |
100 | 104 | ||
101 | public void RemoveRegion(Scene scene) {} | 105 | public void RemoveRegion(Scene scene) {} |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 399e9b0..0e2aba9 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -546,7 +546,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
546 | requiredPowers = GroupPowers.LandManageBanned; | 546 | requiredPowers = GroupPowers.LandManageBanned; |
547 | 547 | ||
548 | if (m_scene.Permissions.CanEditParcelProperties(agentID, | 548 | if (m_scene.Permissions.CanEditParcelProperties(agentID, |
549 | land, requiredPowers)) | 549 | land, requiredPowers, false)) |
550 | { | 550 | { |
551 | land.UpdateAccessList(flags, transactionID, sequenceID, | 551 | land.UpdateAccessList(flags, transactionID, sequenceID, |
552 | sections, entries, remote_client); | 552 | sections, entries, remote_client); |
@@ -908,7 +908,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
908 | 908 | ||
909 | //If we are still here, then they are subdividing within one piece of land | 909 | //If we are still here, then they are subdividing within one piece of land |
910 | //Check owner | 910 | //Check owner |
911 | if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin)) | 911 | if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin, true)) |
912 | { | 912 | { |
913 | return; | 913 | return; |
914 | } | 914 | } |
@@ -977,7 +977,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
977 | { | 977 | { |
978 | return; | 978 | return; |
979 | } | 979 | } |
980 | if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin)) | 980 | if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin, true)) |
981 | { | 981 | { |
982 | return; | 982 | return; |
983 | } | 983 | } |
@@ -1708,7 +1708,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1708 | 1708 | ||
1709 | if (land == null) return; | 1709 | if (land == null) return; |
1710 | 1710 | ||
1711 | if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions)) | 1711 | if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions, false)) |
1712 | return; | 1712 | return; |
1713 | 1713 | ||
1714 | land.LandData.OtherCleanTime = otherCleanTime; | 1714 | land.LandData.OtherCleanTime = otherCleanTime; |
@@ -1808,7 +1808,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1808 | if (targetAvatar.UserLevel == 0) | 1808 | if (targetAvatar.UserLevel == 0) |
1809 | { | 1809 | { |
1810 | ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); | 1810 | ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); |
1811 | if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze)) | 1811 | if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true)) |
1812 | return; | 1812 | return; |
1813 | if (flags == 0) | 1813 | if (flags == 0) |
1814 | { | 1814 | { |
@@ -1857,7 +1857,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1857 | 1857 | ||
1858 | // Check if you even have permission to do this | 1858 | // Check if you even have permission to do this |
1859 | ILandObject land = m_scene.LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); | 1859 | ILandObject land = m_scene.LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); |
1860 | if (!m_scene.Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze) && | 1860 | if (!m_scene.Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true) && |
1861 | !m_scene.Permissions.IsAdministrator(client.AgentId)) | 1861 | !m_scene.Permissions.IsAdministrator(client.AgentId)) |
1862 | return; | 1862 | return; |
1863 | 1863 | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index ce4bd0f..74c2144 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -279,7 +279,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
279 | // ParcelFlags.ForSaleObjects | 279 | // ParcelFlags.ForSaleObjects |
280 | // ParcelFlags.LindenHome | 280 | // ParcelFlags.LindenHome |
281 | 281 | ||
282 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions)) | 282 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions, false)) |
283 | { | 283 | { |
284 | allowedDelta |= (uint)(ParcelFlags.AllowLandmark | | 284 | allowedDelta |= (uint)(ParcelFlags.AllowLandmark | |
285 | ParcelFlags.AllowTerraform | | 285 | ParcelFlags.AllowTerraform | |
@@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
294 | ParcelFlags.AllowFly); | 294 | ParcelFlags.AllowFly); |
295 | } | 295 | } |
296 | 296 | ||
297 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale)) | 297 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale, true)) |
298 | { | 298 | { |
299 | if (args.AuthBuyerID != newData.AuthBuyerID || | 299 | if (args.AuthBuyerID != newData.AuthBuyerID || |
300 | args.SalePrice != newData.SalePrice) | 300 | args.SalePrice != newData.SalePrice) |
@@ -317,7 +317,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
317 | allowedDelta |= (uint)ParcelFlags.ForSale; | 317 | allowedDelta |= (uint)ParcelFlags.ForSale; |
318 | } | 318 | } |
319 | 319 | ||
320 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.FindPlaces)) | 320 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.FindPlaces, false)) |
321 | { | 321 | { |
322 | newData.Category = args.Category; | 322 | newData.Category = args.Category; |
323 | 323 | ||
@@ -326,21 +326,21 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
326 | ParcelFlags.MaturePublish) | (uint)(1 << 23); | 326 | ParcelFlags.MaturePublish) | (uint)(1 << 23); |
327 | } | 327 | } |
328 | 328 | ||
329 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity)) | 329 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity, false)) |
330 | { | 330 | { |
331 | newData.Description = args.Desc; | 331 | newData.Description = args.Desc; |
332 | newData.Name = args.Name; | 332 | newData.Name = args.Name; |
333 | newData.SnapshotID = args.SnapshotID; | 333 | newData.SnapshotID = args.SnapshotID; |
334 | } | 334 | } |
335 | 335 | ||
336 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.SetLandingPoint)) | 336 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.SetLandingPoint, false)) |
337 | { | 337 | { |
338 | newData.LandingType = args.LandingType; | 338 | newData.LandingType = args.LandingType; |
339 | newData.UserLocation = args.UserLocation; | 339 | newData.UserLocation = args.UserLocation; |
340 | newData.UserLookAt = args.UserLookAt; | 340 | newData.UserLookAt = args.UserLookAt; |
341 | } | 341 | } |
342 | 342 | ||
343 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.ChangeMedia)) | 343 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.ChangeMedia, false)) |
344 | { | 344 | { |
345 | newData.MediaAutoScale = args.MediaAutoScale; | 345 | newData.MediaAutoScale = args.MediaAutoScale; |
346 | newData.MediaID = args.MediaID; | 346 | newData.MediaID = args.MediaID; |
@@ -361,7 +361,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
361 | ParcelFlags.UseEstateVoiceChan); | 361 | ParcelFlags.UseEstateVoiceChan); |
362 | } | 362 | } |
363 | 363 | ||
364 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses)) | 364 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses, false)) |
365 | { | 365 | { |
366 | newData.PassHours = args.PassHours; | 366 | newData.PassHours = args.PassHours; |
367 | newData.PassPrice = args.PassPrice; | 367 | newData.PassPrice = args.PassPrice; |
@@ -369,25 +369,27 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
369 | allowedDelta |= (uint)ParcelFlags.UsePassList; | 369 | allowedDelta |= (uint)ParcelFlags.UsePassList; |
370 | } | 370 | } |
371 | 371 | ||
372 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageAllowed)) | 372 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageAllowed, false)) |
373 | { | 373 | { |
374 | allowedDelta |= (uint)(ParcelFlags.UseAccessGroup | | 374 | allowedDelta |= (uint)(ParcelFlags.UseAccessGroup | |
375 | ParcelFlags.UseAccessList); | 375 | ParcelFlags.UseAccessList); |
376 | } | 376 | } |
377 | 377 | ||
378 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageBanned)) | 378 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageBanned, false)) |
379 | { | 379 | { |
380 | allowedDelta |= (uint)(ParcelFlags.UseBanList | | 380 | allowedDelta |= (uint)(ParcelFlags.UseBanList | |
381 | ParcelFlags.DenyAnonymous | | 381 | ParcelFlags.DenyAnonymous | |
382 | ParcelFlags.DenyAgeUnverified); | 382 | ParcelFlags.DenyAgeUnverified); |
383 | } | 383 | } |
384 | 384 | ||
385 | uint preserve = LandData.Flags & ~allowedDelta; | 385 | if (allowedDelta != (uint)ParcelFlags.None) |
386 | newData.Flags = preserve | (args.ParcelFlags & allowedDelta); | 386 | { |
387 | 387 | uint preserve = LandData.Flags & ~allowedDelta; | |
388 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 388 | newData.Flags = preserve | (args.ParcelFlags & allowedDelta); |
389 | 389 | ||
390 | SendLandUpdateToAvatarsOverMe(snap_selection); | 390 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
391 | SendLandUpdateToAvatarsOverMe(snap_selection); | ||
392 | } | ||
391 | } | 393 | } |
392 | 394 | ||
393 | public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) | 395 | public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) |
@@ -943,7 +945,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
943 | 945 | ||
944 | public void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client) | 946 | public void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client) |
945 | { | 947 | { |
946 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions)) | 948 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions, true)) |
947 | { | 949 | { |
948 | List<uint> resultLocalIDs = new List<uint>(); | 950 | List<uint> resultLocalIDs = new List<uint>(); |
949 | try | 951 | try |
@@ -993,7 +995,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
993 | /// </param> | 995 | /// </param> |
994 | public void SendLandObjectOwners(IClientAPI remote_client) | 996 | public void SendLandObjectOwners(IClientAPI remote_client) |
995 | { | 997 | { |
996 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions)) | 998 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions, true)) |
997 | { | 999 | { |
998 | Dictionary<UUID, int> primCount = new Dictionary<UUID, int>(); | 1000 | Dictionary<UUID, int> primCount = new Dictionary<UUID, int>(); |
999 | List<UUID> groups = new List<UUID>(); | 1001 | List<UUID> groups = new List<UUID>(); |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 50855fe..616fe98 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -1047,7 +1047,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1047 | return GenericObjectPermission(editorID, objectID, false); | 1047 | return GenericObjectPermission(editorID, objectID, false); |
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | private bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, Scene scene) | 1050 | private bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager) |
1051 | { | 1051 | { |
1052 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1052 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1053 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1053 | if (m_bypassPermissions) return m_bypassPermissionsValue; |