aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorjustincc2010-12-15 00:35:36 +0000
committerjustincc2010-12-15 00:35:36 +0000
commitb643661938881af6fc782d39e52040ed6d16f03f (patch)
tree162e0667718b2f68e5f4e90cd10f30e6fa374cbb /OpenSim
parentreplace ode.dll with one built without asserts turned on (diff)
parentfix mistake in last change of local.include (diff)
downloadopensim-SC_OLD-b643661938881af6fc782d39e52040ed6d16f03f.zip
opensim-SC_OLD-b643661938881af6fc782d39e52040ed6d16f03f.tar.gz
opensim-SC_OLD-b643661938881af6fc782d39e52040ed6d16f03f.tar.bz2
opensim-SC_OLD-b643661938881af6fc782d39e52040ed6d16f03f.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/IClientAPI.cs7
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs2
-rw-r--r--OpenSim/Region/Application/OpenSim.cs7
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs282
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs16
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs27
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs128
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs14
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs23
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs109
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs3
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs64
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs34
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs202
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs56
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs82
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs15
-rw-r--r--OpenSim/Region/Framework/Interfaces/ILandObject.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs20
-rw-r--r--OpenSim/Region/Framework/Scenes/Prioritizer.cs28
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs40
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs (renamed from OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs)10
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs87
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs6
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs65
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs2
-rw-r--r--OpenSim/Region/Physics/Meshing/SculptMesh.cs2
-rw-r--r--OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs2
-rw-r--r--OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs88
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs91
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs22
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs40
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs36
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs1
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs181
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs29
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs2
-rw-r--r--OpenSim/Services/Interfaces/IUserAccountService.cs2
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs5
-rw-r--r--OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs237
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs5
51 files changed, 1424 insertions, 703 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 027f9c5..b9c9323 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -174,9 +174,10 @@ namespace OpenSim.Framework
174 public delegate void ParcelAccessListRequest( 174 public delegate void ParcelAccessListRequest(
175 UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client); 175 UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client);
176 176
177 public delegate void ParcelAccessListUpdateRequest( 177 public delegate void ParcelAccessListUpdateRequest(UUID agentID, uint flags,
178 UUID agentID, UUID sessionID, uint flags, int landLocalID, List<ParcelManager.ParcelAccessEntry> entries, 178 int landLocalID, UUID transactionID, int sequenceID,
179 IClientAPI remote_client); 179 int sections, List<ParcelManager.ParcelAccessEntry> entries,
180 IClientAPI remote_client);
180 181
181 public delegate void ParcelPropertiesRequest( 182 public delegate void ParcelPropertiesRequest(
182 int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); 183 int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client);
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 3c58a7d..3343f60 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -1845,7 +1845,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1845 /// property in StartHttp() for the HttpListener 1845 /// property in StartHttp() for the HttpListener
1846 public class HttpServerLogWriter : ILogWriter 1846 public class HttpServerLogWriter : ILogWriter
1847 { 1847 {
1848 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 1848// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
1849 1849
1850 public void Write(object source, LogPrio priority, string message) 1850 public void Write(object source, LogPrio priority, string message)
1851 { 1851 {
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index ae2d836..c2dd84c 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -265,10 +265,11 @@ namespace OpenSim
265 LoadOar); 265 LoadOar);
266 266
267 m_console.Commands.AddCommand("region", false, "save oar", 267 m_console.Commands.AddCommand("region", false, "save oar",
268 "save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]", 268 //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
269 "save oar [-p|--profile=<url>] [<OAR path>]",
269 "Save a region's data to an OAR archive.", 270 "Save a region's data to an OAR archive.",
270 "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine 271// "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
271 + "-p|--profile=<url> adds the url of the profile service to the saved user information" + Environment.NewLine 272 "-p|--profile=<url> adds the url of the profile service to the saved user information" + Environment.NewLine
272 + "The OAR path must be a filesystem path." 273 + "The OAR path must be a filesystem path."
273 + " If this is not given then the oar is saved to region.oar in the current directory.", 274 + " If this is not given then the oar is saved to region.oar in the current directory.",
274 SaveOar); 275 SaveOar);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index f125822..2a59a0c 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3553,111 +3553,114 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3553 OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>(); 3553 OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>();
3554 OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>(); 3554 OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>();
3555 OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>(); 3555 OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>();
3556 OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseAgentUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>();
3556 3557
3557 if (maxUpdates <= 0) maxUpdates = Int32.MaxValue; 3558 if (maxUpdates <= 0) maxUpdates = Int32.MaxValue;
3558 int updatesThisCall = 0; 3559 int updatesThisCall = 0;
3559 3560
3560 lock (m_entityUpdates.SyncRoot) 3561 EntityUpdate update;
3562 while (updatesThisCall < maxUpdates)
3561 { 3563 {
3562 EntityUpdate update; 3564 lock (m_entityUpdates.SyncRoot)
3563 while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update)) 3565 if (!m_entityUpdates.TryDequeue(out update))
3564 { 3566 break;
3565 if (update.Entity is SceneObjectPart) 3567
3568 if (update.Entity is SceneObjectPart)
3569 {
3570 SceneObjectPart part = (SceneObjectPart)update.Entity;
3571
3572 // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
3573 // will never receive an update after a prim kill. Even then, keeping the kill record may be a good
3574 // safety measure.
3575 //
3576 // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update
3577 // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs
3578 // updates and kills on different threads with different scheduling strategies, hence this protection.
3579 //
3580 // This doesn't appear to apply to child prims - a client will happily ignore these updates
3581 // after the root prim has been deleted.
3582 if (m_killRecord.Contains(part.LocalId))
3566 { 3583 {
3567 SceneObjectPart part = (SceneObjectPart)update.Entity; 3584 // m_log.WarnFormat(
3568 3585 // "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted",
3569 // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client 3586 // part.LocalId, Name);
3570 // will never receive an update after a prim kill. Even then, keeping the kill record may be a good 3587 continue;
3571 // safety measure. 3588 }
3572 //
3573 // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update
3574 // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs
3575 // updates and kills on different threads with different scheduling strategies, hence this protection.
3576 //
3577 // This doesn't appear to apply to child prims - a client will happily ignore these updates
3578 // after the root prim has been deleted.
3579 if (m_killRecord.Contains(part.LocalId))
3580 {
3581 // m_log.WarnFormat(
3582 // "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted",
3583 // part.LocalId, Name);
3584 continue;
3585 }
3586 3589
3587 if (part.ParentGroup.IsAttachment && m_disableFacelights) 3590 if (part.ParentGroup.IsAttachment && m_disableFacelights)
3591 {
3592 if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand &&
3593 part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand)
3588 { 3594 {
3589 if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && 3595 part.Shape.LightEntry = false;
3590 part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand)
3591 {
3592 part.Shape.LightEntry = false;
3593 }
3594 } 3596 }
3595 } 3597 }
3598 }
3599
3600 ++updatesThisCall;
3596 3601
3597 ++updatesThisCall; 3602 #region UpdateFlags to packet type conversion
3598 3603
3599 #region UpdateFlags to packet type conversion 3604 PrimUpdateFlags updateFlags = update.Flags;
3600 3605
3601 PrimUpdateFlags updateFlags = update.Flags; 3606 bool canUseCompressed = true;
3607 bool canUseImproved = true;
3602 3608
3603 bool canUseCompressed = true; 3609 // Compressed object updates only make sense for LL primitives
3604 bool canUseImproved = true; 3610 if (!(update.Entity is SceneObjectPart))
3611 {
3612 canUseCompressed = false;
3613 }
3605 3614
3606 // Compressed object updates only make sense for LL primitives 3615 if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate))
3607 if (!(update.Entity is SceneObjectPart)) 3616 {
3617 canUseCompressed = false;
3618 canUseImproved = false;
3619 }
3620 else
3621 {
3622 if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) ||
3623 updateFlags.HasFlag(PrimUpdateFlags.Acceleration) ||
3624 updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) ||
3625 updateFlags.HasFlag(PrimUpdateFlags.Joint))
3608 { 3626 {
3609 canUseCompressed = false; 3627 canUseCompressed = false;
3610 } 3628 }
3611 3629
3612 if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate)) 3630 if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) ||
3631 updateFlags.HasFlag(PrimUpdateFlags.ParentID) ||
3632 updateFlags.HasFlag(PrimUpdateFlags.Scale) ||
3633 updateFlags.HasFlag(PrimUpdateFlags.PrimData) ||
3634 updateFlags.HasFlag(PrimUpdateFlags.Text) ||
3635 updateFlags.HasFlag(PrimUpdateFlags.NameValue) ||
3636 updateFlags.HasFlag(PrimUpdateFlags.ExtraData) ||
3637 updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) ||
3638 updateFlags.HasFlag(PrimUpdateFlags.Sound) ||
3639 updateFlags.HasFlag(PrimUpdateFlags.Particles) ||
3640 updateFlags.HasFlag(PrimUpdateFlags.Material) ||
3641 updateFlags.HasFlag(PrimUpdateFlags.ClickAction) ||
3642 updateFlags.HasFlag(PrimUpdateFlags.MediaURL) ||
3643 updateFlags.HasFlag(PrimUpdateFlags.Joint))
3613 { 3644 {
3614 canUseCompressed = false;
3615 canUseImproved = false; 3645 canUseImproved = false;
3616 } 3646 }
3617 else 3647 }
3618 {
3619 if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) ||
3620 updateFlags.HasFlag(PrimUpdateFlags.Acceleration) ||
3621 updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) ||
3622 updateFlags.HasFlag(PrimUpdateFlags.Joint))
3623 {
3624 canUseCompressed = false;
3625 }
3626
3627 if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) ||
3628 updateFlags.HasFlag(PrimUpdateFlags.ParentID) ||
3629 updateFlags.HasFlag(PrimUpdateFlags.Scale) ||
3630 updateFlags.HasFlag(PrimUpdateFlags.PrimData) ||
3631 updateFlags.HasFlag(PrimUpdateFlags.Text) ||
3632 updateFlags.HasFlag(PrimUpdateFlags.NameValue) ||
3633 updateFlags.HasFlag(PrimUpdateFlags.ExtraData) ||
3634 updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) ||
3635 updateFlags.HasFlag(PrimUpdateFlags.Sound) ||
3636 updateFlags.HasFlag(PrimUpdateFlags.Particles) ||
3637 updateFlags.HasFlag(PrimUpdateFlags.Material) ||
3638 updateFlags.HasFlag(PrimUpdateFlags.ClickAction) ||
3639 updateFlags.HasFlag(PrimUpdateFlags.MediaURL) ||
3640 updateFlags.HasFlag(PrimUpdateFlags.Joint))
3641 {
3642 canUseImproved = false;
3643 }
3644 }
3645 3648
3646 #endregion UpdateFlags to packet type conversion 3649 #endregion UpdateFlags to packet type conversion
3647 3650
3648 #region Block Construction 3651 #region Block Construction
3649 3652
3650 // TODO: Remove this once we can build compressed updates 3653 // TODO: Remove this once we can build compressed updates
3651 canUseCompressed = false; 3654 canUseCompressed = false;
3652 3655
3653 if (!canUseImproved && !canUseCompressed) 3656 if (!canUseImproved && !canUseCompressed)
3657 {
3658 if (update.Entity is ScenePresence)
3659 {
3660 objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity));
3661 }
3662 else
3654 { 3663 {
3655 if (update.Entity is ScenePresence)
3656 {
3657 objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity));
3658 }
3659 else
3660 {
3661// if (update.Entity is SceneObjectPart && ((SceneObjectPart)update.Entity).IsAttachment) 3664// if (update.Entity is SceneObjectPart && ((SceneObjectPart)update.Entity).IsAttachment)
3662// { 3665// {
3663// SceneObjectPart sop = (SceneObjectPart)update.Entity; 3666// SceneObjectPart sop = (SceneObjectPart)update.Entity;
@@ -3686,71 +3689,90 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3686// } 3689// }
3687// else 3690// else
3688// { 3691// {
3689 objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId)); 3692 objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId));
3690// } 3693// }
3691 }
3692 }
3693 else if (!canUseImproved)
3694 {
3695 compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags));
3696 } 3694 }
3695 }
3696 else if (!canUseImproved)
3697 {
3698 compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags));
3699 }
3700 else
3701 {
3702 if (update.Entity is ScenePresence && ((ScenePresence)update.Entity).UUID == AgentId)
3703 // Self updates go into a special list
3704 terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
3697 else 3705 else
3698 { 3706 // Everything else goes here
3699 terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); 3707 terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
3700 }
3701
3702 #endregion Block Construction
3703 } 3708 }
3704 3709
3705 #region Packet Sending 3710 #endregion Block Construction
3706 3711 }
3707 const float TIME_DILATION = 1.0f; 3712
3708 ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); 3713 #region Packet Sending
3709 3714
3710 if (objectUpdateBlocks.IsValueCreated) 3715 const float TIME_DILATION = 1.0f;
3711 { 3716 ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f);
3712 List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value; 3717
3718 if (terseAgentUpdateBlocks.IsValueCreated)
3719 {
3720 List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value;
3721
3722 ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
3723 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
3724 packet.RegionData.TimeDilation = timeDilation;
3725 packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
3726
3727 for (int i = 0; i < blocks.Count; i++)
3728 packet.ObjectData[i] = blocks[i];
3729
3730 OutPacket(packet, ThrottleOutPacketType.Unknown, true);
3731 }
3732
3733 if (objectUpdateBlocks.IsValueCreated)
3734 {
3735 List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value;
3713 3736
3714 ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); 3737 ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
3715 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; 3738 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
3716 packet.RegionData.TimeDilation = timeDilation; 3739 packet.RegionData.TimeDilation = timeDilation;
3717 packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count]; 3740 packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count];
3718 3741
3719 for (int i = 0; i < blocks.Count; i++) 3742 for (int i = 0; i < blocks.Count; i++)
3720 packet.ObjectData[i] = blocks[i]; 3743 packet.ObjectData[i] = blocks[i];
3721 3744
3722 OutPacket(packet, ThrottleOutPacketType.Task, true); 3745 OutPacket(packet, ThrottleOutPacketType.Task, true);
3723 } 3746 }
3724 3747
3725 if (compressedUpdateBlocks.IsValueCreated) 3748 if (compressedUpdateBlocks.IsValueCreated)
3726 { 3749 {
3727 List<ObjectUpdateCompressedPacket.ObjectDataBlock> blocks = compressedUpdateBlocks.Value; 3750 List<ObjectUpdateCompressedPacket.ObjectDataBlock> blocks = compressedUpdateBlocks.Value;
3728 3751
3729 ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); 3752 ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed);
3730 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; 3753 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
3731 packet.RegionData.TimeDilation = timeDilation; 3754 packet.RegionData.TimeDilation = timeDilation;
3732 packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; 3755 packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count];
3733 3756
3734 for (int i = 0; i < blocks.Count; i++) 3757 for (int i = 0; i < blocks.Count; i++)
3735 packet.ObjectData[i] = blocks[i]; 3758 packet.ObjectData[i] = blocks[i];
3736 3759
3737 OutPacket(packet, ThrottleOutPacketType.Task, true); 3760 OutPacket(packet, ThrottleOutPacketType.Task, true);
3738 } 3761 }
3739 3762
3740 if (terseUpdateBlocks.IsValueCreated) 3763 if (terseUpdateBlocks.IsValueCreated)
3741 { 3764 {
3742 List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value; 3765 List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value;
3743 3766
3744 ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); 3767 ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
3745 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; 3768 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
3746 packet.RegionData.TimeDilation = timeDilation; 3769 packet.RegionData.TimeDilation = timeDilation;
3747 packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; 3770 packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
3748 3771
3749 for (int i = 0; i < blocks.Count; i++) 3772 for (int i = 0; i < blocks.Count; i++)
3750 packet.ObjectData[i] = blocks[i]; 3773 packet.ObjectData[i] = blocks[i];
3751 3774
3752 OutPacket(packet, ThrottleOutPacketType.Task, true); 3775 OutPacket(packet, ThrottleOutPacketType.Task, true);
3753 }
3754 } 3776 }
3755 3777
3756 #endregion Packet Sending 3778 #endregion Packet Sending
@@ -8239,7 +8261,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8239 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 8261 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
8240 entry.AgentID = block.ID; 8262 entry.AgentID = block.ID;
8241 entry.Flags = (AccessList)block.Flags; 8263 entry.Flags = (AccessList)block.Flags;
8242 entry.Time = new DateTime(); 8264 entry.Time = Util.ToDateTime(block.Time);
8243 entries.Add(entry); 8265 entries.Add(entry);
8244 } 8266 }
8245 8267
@@ -8247,8 +8269,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8247 if (handlerParcelAccessListUpdateRequest != null) 8269 if (handlerParcelAccessListUpdateRequest != null)
8248 { 8270 {
8249 handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID, 8271 handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID,
8250 updatePacket.AgentData.SessionID, updatePacket.Data.Flags, 8272 updatePacket.Data.Flags,
8251 updatePacket.Data.LocalID, entries, this); 8273 updatePacket.Data.LocalID,
8274 updatePacket.Data.TransactionID,
8275 updatePacket.Data.SequenceID,
8276 updatePacket.Data.Sections,
8277 entries, this);
8252 } 8278 }
8253 return true; 8279 return true;
8254 } 8280 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
index ac2ad7a..1f60e36 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
@@ -226,7 +226,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
226 } 226 }
227 else 227 else
228 { 228 {
229 AssetBase newTexture = new AssetBase(texture.ID + "-" + format, texture.Name, (sbyte)AssetType.Texture, texture.CreatorID); 229 AssetBase newTexture = new AssetBase(texture.ID + "-" + format, texture.Name, (sbyte)AssetType.Texture, texture.Metadata.CreatorID);
230 newTexture.Data = ConvertTextureData(texture, format); 230 newTexture.Data = ConvertTextureData(texture, format);
231 if (newTexture.Data.Length == 0) 231 if (newTexture.Data.Length == 0)
232 return false; // !!! Caller try another codec, please! 232 return false; // !!! Caller try another codec, please!
@@ -336,7 +336,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
336 336
337 try 337 try
338 { 338 {
339 // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data 339 // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular data
340 340
341 imgstream = new MemoryStream(); 341 imgstream = new MemoryStream();
342 342
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 1f49a01..360a014 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -484,6 +484,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
484 } 484 }
485 } 485 }
486 486
487 public void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos)
488 {
489 // First we save the
490 // attachment point information, then we update the relative
491 // positioning. Then we have to mark the object as NOT an
492 // attachment. This is necessary in order to correctly save
493 // and retrieve GroupPosition information for the attachment.
494 // Finally, we restore the object's attachment status.
495 byte attachmentPoint = sog.GetAttachmentPoint();
496 sog.UpdateGroupPosition(pos);
497 sog.RootPart.IsAttachment = false;
498 sog.AbsolutePosition = sog.RootPart.AttachedPos;
499 sog.SetAttachmentPoint(attachmentPoint);
500 sog.HasGroupChanged = true;
501 }
502
487 /// <summary> 503 /// <summary>
488 /// Update the attachment asset for the new sog details if they have changed. 504 /// Update the attachment asset for the new sog details if they have changed.
489 /// </summary> 505 /// </summary>
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index cab341d..5e5f6c0 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -156,7 +156,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
156 /// <param name="inventoryFolder">The inventory folder to save</param> 156 /// <param name="inventoryFolder">The inventory folder to save</param>
157 /// <param name="path">The path to which the folder should be saved</param> 157 /// <param name="path">The path to which the folder should be saved</param>
158 /// <param name="saveThisFolderItself">If true, save this folder itself. If false, only saves contents</param> 158 /// <param name="saveThisFolderItself">If true, save this folder itself. If false, only saves contents</param>
159 protected void SaveInvFolder(InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, Dictionary<string, object> options, IUserAccountService userAccountService) 159 /// <param name="options"></param>
160 /// <param name="userAccountService"></param>
161 protected void SaveInvFolder(
162 InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself,
163 Dictionary<string, object> options, IUserAccountService userAccountService)
160 { 164 {
161 if (saveThisFolderItself) 165 if (saveThisFolderItself)
162 { 166 {
@@ -249,7 +253,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
249 253
250 // Write out control file. This has to be done first so that subsequent loaders will see this file first 254 // Write out control file. This has to be done first so that subsequent loaders will see this file first
251 // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this 255 // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this
252 m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); 256 // not sure how to fix this though, short of going with a completely different file format.
257 m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile(options));
253 m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive."); 258 m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive.");
254 259
255 if (inventoryFolder != null) 260 if (inventoryFolder != null)
@@ -372,12 +377,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
372 } 377 }
373 378
374 /// <summary> 379 /// <summary>
375 /// Create the control file for a 0.1 version archive 380 /// Create the control file for the archive
376 /// </summary> 381 /// </summary>
382 /// <param name="options"></param>
377 /// <returns></returns> 383 /// <returns></returns>
378 public static string Create0p1ControlFile() 384 public static string CreateControlFile(Dictionary<string, object> options)
379 { 385 {
380 int majorVersion = 0, minorVersion = 1; 386 int majorVersion, minorVersion;
387
388 if (options.ContainsKey("profile"))
389 {
390 majorVersion = 1;
391 minorVersion = 0;
392 }
393 else
394 {
395 majorVersion = 0;
396 minorVersion = 1;
397 }
381 398
382 m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion); 399 m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion);
383 400
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index b33c2b1..1e18095 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
55 /// <value> 55 /// <value>
56 /// Enable or disable checking whether the iar user is actually logged in 56 /// Enable or disable checking whether the iar user is actually logged in
57 /// </value> 57 /// </value>
58 public bool DisablePresenceChecks { get; set; } 58// public bool DisablePresenceChecks { get; set; }
59 59
60 public event InventoryArchiveSaved OnInventoryArchiveSaved; 60 public event InventoryArchiveSaved OnInventoryArchiveSaved;
61 61
@@ -95,10 +95,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
95 95
96 public InventoryArchiverModule() {} 96 public InventoryArchiverModule() {}
97 97
98 public InventoryArchiverModule(bool disablePresenceChecks) 98// public InventoryArchiverModule(bool disablePresenceChecks)
99 { 99// {
100 DisablePresenceChecks = disablePresenceChecks; 100// DisablePresenceChecks = disablePresenceChecks;
101 } 101// }
102 102
103 public void Initialise(Scene scene, IConfigSource source) 103 public void Initialise(Scene scene, IConfigSource source)
104 { 104 {
@@ -172,8 +172,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
172 172
173 if (userInfo != null) 173 if (userInfo != null)
174 { 174 {
175 if (CheckPresence(userInfo.PrincipalID)) 175// if (CheckPresence(userInfo.PrincipalID))
176 { 176// {
177 try 177 try
178 { 178 {
179 new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(options, UserAccountService); 179 new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(options, UserAccountService);
@@ -189,13 +189,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
189 } 189 }
190 190
191 return true; 191 return true;
192 } 192// }
193 else 193// else
194 { 194// {
195 m_log.ErrorFormat( 195// m_log.ErrorFormat(
196 "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", 196// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
197 userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); 197// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
198 } 198// }
199 } 199 }
200 } 200 }
201 201
@@ -212,8 +212,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
212 212
213 if (userInfo != null) 213 if (userInfo != null)
214 { 214 {
215 if (CheckPresence(userInfo.PrincipalID)) 215// if (CheckPresence(userInfo.PrincipalID))
216 { 216// {
217 try 217 try
218 { 218 {
219 new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(options, UserAccountService); 219 new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(options, UserAccountService);
@@ -229,13 +229,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
229 } 229 }
230 230
231 return true; 231 return true;
232 } 232// }
233 else 233// else
234 { 234// {
235 m_log.ErrorFormat( 235// m_log.ErrorFormat(
236 "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", 236// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
237 userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); 237// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
238 } 238// }
239 } 239 }
240 } 240 }
241 241
@@ -257,9 +257,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
257 257
258 if (userInfo != null) 258 if (userInfo != null)
259 { 259 {
260 if (CheckPresence(userInfo.PrincipalID)) 260// if (CheckPresence(userInfo.PrincipalID))
261 { 261// {
262
263 InventoryArchiveReadRequest request; 262 InventoryArchiveReadRequest request;
264 bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); 263 bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false);
265 264
@@ -280,13 +279,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
280 UpdateClientWithLoadedNodes(userInfo, request.Execute()); 279 UpdateClientWithLoadedNodes(userInfo, request.Execute());
281 280
282 return true; 281 return true;
283 } 282// }
284 else 283// else
285 { 284// {
286 m_log.ErrorFormat( 285// m_log.ErrorFormat(
287 "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", 286// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
288 userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); 287// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
289 } 288// }
290 } 289 }
291 else 290 else
292 m_log.ErrorFormat("[INVENTORY ARCHIVER]: User {0} {1} not found", 291 m_log.ErrorFormat("[INVENTORY ARCHIVER]: User {0} {1} not found",
@@ -306,8 +305,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
306 305
307 if (userInfo != null) 306 if (userInfo != null)
308 { 307 {
309 if (CheckPresence(userInfo.PrincipalID)) 308// if (CheckPresence(userInfo.PrincipalID))
310 { 309// {
311 InventoryArchiveReadRequest request; 310 InventoryArchiveReadRequest request;
312 bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); 311 bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false);
313 312
@@ -328,13 +327,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
328 UpdateClientWithLoadedNodes(userInfo, request.Execute()); 327 UpdateClientWithLoadedNodes(userInfo, request.Execute());
329 328
330 return true; 329 return true;
331 } 330// }
332 else 331// else
333 { 332// {
334 m_log.ErrorFormat( 333// m_log.ErrorFormat(
335 "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", 334// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
336 userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); 335// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
337 } 336// }
338 } 337 }
339 } 338 }
340 339
@@ -529,28 +528,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
529 } 528 }
530 } 529 }
531 530
532 /// <summary> 531// /// <summary>
533 /// Check if the given user is present in any of the scenes. 532// /// Check if the given user is present in any of the scenes.
534 /// </summary> 533// /// </summary>
535 /// <param name="userId">The user to check</param> 534// /// <param name="userId">The user to check</param>
536 /// <returns>true if the user is in any of the scenes, false otherwise</returns> 535// /// <returns>true if the user is in any of the scenes, false otherwise</returns>
537 protected bool CheckPresence(UUID userId) 536// protected bool CheckPresence(UUID userId)
538 { 537// {
539 if (DisablePresenceChecks) 538// if (DisablePresenceChecks)
540 return true; 539// return true;
541 540//
542 foreach (Scene scene in m_scenes.Values) 541// foreach (Scene scene in m_scenes.Values)
543 { 542// {
544 ScenePresence p; 543// ScenePresence p;
545 if ((p = scene.GetScenePresence(userId)) != null) 544// if ((p = scene.GetScenePresence(userId)) != null)
546 { 545// {
547 p.ControllingClient.SendAgentAlertMessage("Inventory operation has been started", false); 546// p.ControllingClient.SendAgentAlertMessage("Inventory operation has been started", false);
548 return true; 547// return true;
549 } 548// }
550 } 549// }
551 550//
552 return false; 551// return false;
553 } 552// }
554
555 } 553 }
556} 554}
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 2747e15..76d0b85 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -120,7 +120,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
120 TestHelper.InMethod(); 120 TestHelper.InMethod();
121// log4net.Config.XmlConfigurator.Configure(); 121// log4net.Config.XmlConfigurator.Configure();
122 122
123 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); 123 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
124 124
125 Scene scene = SceneSetupHelpers.SetupScene("Inventory"); 125 Scene scene = SceneSetupHelpers.SetupScene("Inventory");
126 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 126 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
@@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
238 TestHelper.InMethod(); 238 TestHelper.InMethod();
239// log4net.Config.XmlConfigurator.Configure(); 239// log4net.Config.XmlConfigurator.Configure();
240 240
241 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); 241 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
242 242
243 Scene scene = SceneSetupHelpers.SetupScene("Inventory"); 243 Scene scene = SceneSetupHelpers.SetupScene("Inventory");
244 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 244 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
@@ -355,7 +355,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
355// log4net.Config.XmlConfigurator.Configure(); 355// log4net.Config.XmlConfigurator.Configure();
356 356
357 SerialiserModule serialiserModule = new SerialiserModule(); 357 SerialiserModule serialiserModule = new SerialiserModule();
358 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); 358 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
359 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 359 Scene scene = SceneSetupHelpers.SetupScene("inventory");
360 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 360 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
361 361
@@ -382,7 +382,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
382 //log4net.Config.XmlConfigurator.Configure(); 382 //log4net.Config.XmlConfigurator.Configure();
383 383
384 SerialiserModule serialiserModule = new SerialiserModule(); 384 SerialiserModule serialiserModule = new SerialiserModule();
385 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); 385 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
386 386
387 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene 387 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
388 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 388 Scene scene = SceneSetupHelpers.SetupScene("inventory");
@@ -443,7 +443,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
443 string humanEscapedItemName = @"You & you are a mean\/man\/"; 443 string humanEscapedItemName = @"You & you are a mean\/man\/";
444 string userPassword = "meowfood"; 444 string userPassword = "meowfood";
445 445
446 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); 446 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
447 447
448 Scene scene = SceneSetupHelpers.SetupScene("Inventory"); 448 Scene scene = SceneSetupHelpers.SetupScene("Inventory");
449 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 449 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
@@ -558,7 +558,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
558 558
559 MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); 559 MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
560 SerialiserModule serialiserModule = new SerialiserModule(); 560 SerialiserModule serialiserModule = new SerialiserModule();
561 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); 561 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
562 562
563 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene 563 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
564 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 564 Scene scene = SceneSetupHelpers.SetupScene("inventory");
@@ -619,7 +619,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
619 619
620 // MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); 620 // MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
621 // SerialiserModule serialiserModule = new SerialiserModule(); 621 // SerialiserModule serialiserModule = new SerialiserModule();
622 // InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); 622 // InventoryArchiverModule archiverModule = new InventoryArchiverModule();
623 623
624 // // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene 624 // // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
625 // Scene scene = SceneSetupHelpers.SetupScene(); 625 // Scene scene = SceneSetupHelpers.SetupScene();
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index fd28ba0..a3251aa 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1299,7 +1299,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1299 #region Agent Arrived 1299 #region Agent Arrived
1300 public void AgentArrivedAtDestination(UUID id) 1300 public void AgentArrivedAtDestination(UUID id)
1301 { 1301 {
1302 //m_log.Debug(" >>> ReleaseAgent called <<< "); 1302 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Agent {0} released", id);
1303 ResetFromTransit(id); 1303 ResetFromTransit(id);
1304 } 1304 }
1305 1305
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
index 3291be4..7316e5b 100644
--- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
@@ -165,7 +165,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
165 int width = 256; 165 int width = 256;
166 int height = 256; 166 int height = 256;
167 int alpha = 255; // 0 is transparent 167 int alpha = 255; // 0 is transparent
168 Color bgColour = Color.White; // Default background color 168 Color bgColor = Color.White; // Default background color
169 char altDataDelim = ';'; 169 char altDataDelim = ';';
170 170
171 char[] paramDelimiter = { ',' }; 171 char[] paramDelimiter = { ',' };
@@ -253,15 +253,16 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
253 alpha = 256; 253 alpha = 256;
254 } 254 }
255 break; 255 break;
256 case "bgcolor":
256 case "bgcolour": 257 case "bgcolour":
257 int hex = 0; 258 int hex = 0;
258 if (Int32.TryParse(value, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) 259 if (Int32.TryParse(value, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex))
259 { 260 {
260 bgColour = Color.FromArgb(hex); 261 bgColor = Color.FromArgb(hex);
261 } 262 }
262 else 263 else
263 { 264 {
264 bgColour = Color.FromName(value); 265 bgColor = Color.FromName(value);
265 } 266 }
266 break; 267 break;
267 case "altdatadelim": 268 case "altdatadelim":
@@ -315,7 +316,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
315 // background color in their scripts, only do when fully opaque 316 // background color in their scripts, only do when fully opaque
316 if (alpha >= 255) 317 if (alpha >= 255)
317 { 318 {
318 graph.FillRectangle(new SolidBrush(bgColour), 0, 0, width, height); 319 graph.FillRectangle(new SolidBrush(bgColor), 0, 0, width, height);
319 } 320 }
320 321
321 for (int w = 0; w < bitmap.Width; w++) 322 for (int w = 0; w < bitmap.Width; w++)
@@ -616,25 +617,25 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
616 } 617 }
617 } 618 }
618 } 619 }
619 else if (nextLine.StartsWith("PenColour")) 620 else if (nextLine.StartsWith("PenColour") || nextLine.StartsWith("PenColor"))
620 { 621 {
621 nextLine = nextLine.Remove(0, 9); 622 nextLine = nextLine.Remove(0, 9);
622 nextLine = nextLine.Trim(); 623 nextLine = nextLine.Trim();
623 int hex = 0; 624 int hex = 0;
624 625
625 Color newColour; 626 Color newColor;
626 if (Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) 627 if (Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex))
627 { 628 {
628 newColour = Color.FromArgb(hex); 629 newColor = Color.FromArgb(hex);
629 } 630 }
630 else 631 else
631 { 632 {
632 // this doesn't fail, it just returns black if nothing is found 633 // this doesn't fail, it just returns black if nothing is found
633 newColour = Color.FromName(nextLine); 634 newColor = Color.FromName(nextLine);
634 } 635 }
635 636
636 myBrush.Color = newColour; 637 myBrush.Color = newColor;
637 drawPen.Color = newColour; 638 drawPen.Color = newColor;
638 } 639 }
639 } 640 }
640 } 641 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
index 16e25e6..dfba0d6 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
@@ -41,8 +41,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41 41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid 42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
43{ 43{
44 public class RemoteGridServicesConnector : 44 public class RemoteGridServicesConnector : ISharedRegionModule, IGridService
45 GridServicesConnector, ISharedRegionModule, IGridService
46 { 45 {
47 private static readonly ILog m_log = 46 private static readonly ILog m_log =
48 LogManager.GetLogger( 47 LogManager.GetLogger(
@@ -51,6 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
51 private bool m_Enabled = false; 50 private bool m_Enabled = false;
52 51
53 private IGridService m_LocalGridService; 52 private IGridService m_LocalGridService;
53 private IGridService m_RemoteGridService;
54 54
55 public RemoteGridServicesConnector() 55 public RemoteGridServicesConnector()
56 { 56 {
@@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
73 get { return "RemoteGridServicesConnector"; } 73 get { return "RemoteGridServicesConnector"; }
74 } 74 }
75 75
76 public override void Initialise(IConfigSource source) 76 public void Initialise(IConfigSource source)
77 { 77 {
78 IConfig moduleConfig = source.Configs["Modules"]; 78 IConfig moduleConfig = source.Configs["Modules"];
79 if (moduleConfig != null) 79 if (moduleConfig != null)
@@ -97,9 +97,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
97 return; 97 return;
98 } 98 }
99 99
100 base.Initialise(source);
101
102 m_LocalGridService = new LocalGridServicesConnector(source); 100 m_LocalGridService = new LocalGridServicesConnector(source);
101 m_RemoteGridService = new GridServicesConnector(source);
103 } 102 }
104 103
105 public void PostInitialise() 104 public void PostInitialise()
@@ -135,61 +134,61 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
135 134
136 #region IGridService 135 #region IGridService
137 136
138 public override string RegisterRegion(UUID scopeID, GridRegion regionInfo) 137 public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
139 { 138 {
140 string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo); 139 string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo);
141 140
142 if (msg == String.Empty) 141 if (msg == String.Empty)
143 return base.RegisterRegion(scopeID, regionInfo); 142 return m_RemoteGridService.RegisterRegion(scopeID, regionInfo);
144 143
145 return msg; 144 return msg;
146 } 145 }
147 146
148 public override bool DeregisterRegion(UUID regionID) 147 public bool DeregisterRegion(UUID regionID)
149 { 148 {
150 if (m_LocalGridService.DeregisterRegion(regionID)) 149 if (m_LocalGridService.DeregisterRegion(regionID))
151 return base.DeregisterRegion(regionID); 150 return m_RemoteGridService.DeregisterRegion(regionID);
152 151
153 return false; 152 return false;
154 } 153 }
155 154
156 public override List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) 155 public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
157 { 156 {
158 return base.GetNeighbours(scopeID, regionID); 157 return m_RemoteGridService.GetNeighbours(scopeID, regionID);
159 } 158 }
160 159
161 public override GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) 160 public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
162 { 161 {
163 GridRegion rinfo = m_LocalGridService.GetRegionByUUID(scopeID, regionID); 162 GridRegion rinfo = m_LocalGridService.GetRegionByUUID(scopeID, regionID);
164 if (rinfo == null) 163 if (rinfo == null)
165 rinfo = base.GetRegionByUUID(scopeID, regionID); 164 rinfo = m_RemoteGridService.GetRegionByUUID(scopeID, regionID);
166 165
167 return rinfo; 166 return rinfo;
168 } 167 }
169 168
170 public override GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 169 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
171 { 170 {
172 GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y); 171 GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
173 if (rinfo == null) 172 if (rinfo == null)
174 rinfo = base.GetRegionByPosition(scopeID, x, y); 173 rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y);
175 174
176 return rinfo; 175 return rinfo;
177 } 176 }
178 177
179 public override GridRegion GetRegionByName(UUID scopeID, string regionName) 178 public GridRegion GetRegionByName(UUID scopeID, string regionName)
180 { 179 {
181 GridRegion rinfo = m_LocalGridService.GetRegionByName(scopeID, regionName); 180 GridRegion rinfo = m_LocalGridService.GetRegionByName(scopeID, regionName);
182 if (rinfo == null) 181 if (rinfo == null)
183 rinfo = base.GetRegionByName(scopeID, regionName); 182 rinfo = m_RemoteGridService.GetRegionByName(scopeID, regionName);
184 183
185 return rinfo; 184 return rinfo;
186 } 185 }
187 186
188 public override List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) 187 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
189 { 188 {
190 List<GridRegion> rinfo = m_LocalGridService.GetRegionsByName(scopeID, name, maxNumber); 189 List<GridRegion> rinfo = m_LocalGridService.GetRegionsByName(scopeID, name, maxNumber);
191 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionsByName {0} found {1} regions", name, rinfo.Count); 190 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionsByName {0} found {1} regions", name, rinfo.Count);
192 List<GridRegion> grinfo = base.GetRegionsByName(scopeID, name, maxNumber); 191 List<GridRegion> grinfo = m_RemoteGridService.GetRegionsByName(scopeID, name, maxNumber);
193 192
194 if (grinfo != null) 193 if (grinfo != null)
195 { 194 {
@@ -202,13 +201,79 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
202 return rinfo; 201 return rinfo;
203 } 202 }
204 203
205 // Let's not override GetRegionRange -- let's get them all from the grid server 204 public virtual List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
205 {
206 List<GridRegion> rinfo = m_LocalGridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax);
207 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionRange {0} found {1} regions", name, rinfo.Count);
208 List<GridRegion> grinfo = m_RemoteGridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax);
209
210 if (grinfo != null)
211 {
212 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetRegionRange {0} found {1} regions", name, grinfo.Count);
213 foreach (GridRegion r in grinfo)
214 if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
215 rinfo.Add(r);
216 }
217
218 return rinfo;
219 }
220
221 public List<GridRegion> GetDefaultRegions(UUID scopeID)
222 {
223 List<GridRegion> rinfo = m_LocalGridService.GetDefaultRegions(scopeID);
224 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetDefaultRegions {0} found {1} regions", name, rinfo.Count);
225 List<GridRegion> grinfo = m_RemoteGridService.GetDefaultRegions(scopeID);
226
227 if (grinfo != null)
228 {
229 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetDefaultRegions {0} found {1} regions", name, grinfo.Count);
230 foreach (GridRegion r in grinfo)
231 if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
232 rinfo.Add(r);
233 }
234
235 return rinfo;
236 }
237
238 public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y)
239 {
240 List<GridRegion> rinfo = m_LocalGridService.GetFallbackRegions(scopeID, x, y);
241 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetFallbackRegions {0} found {1} regions", name, rinfo.Count);
242 List<GridRegion> grinfo = m_RemoteGridService.GetFallbackRegions(scopeID, x, y);
243
244 if (grinfo != null)
245 {
246 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetFallbackRegions {0} found {1} regions", name, grinfo.Count);
247 foreach (GridRegion r in grinfo)
248 if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
249 rinfo.Add(r);
250 }
251
252 return rinfo;
253 }
254
255 public List<GridRegion> GetHyperlinks(UUID scopeID)
256 {
257 List<GridRegion> rinfo = m_LocalGridService.GetHyperlinks(scopeID);
258 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetHyperlinks {0} found {1} regions", name, rinfo.Count);
259 List<GridRegion> grinfo = m_RemoteGridService.GetHyperlinks(scopeID);
260
261 if (grinfo != null)
262 {
263 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetHyperlinks {0} found {1} regions", name, grinfo.Count);
264 foreach (GridRegion r in grinfo)
265 if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
266 rinfo.Add(r);
267 }
268
269 return rinfo;
270 }
206 271
207 public override int GetRegionFlags(UUID scopeID, UUID regionID) 272 public int GetRegionFlags(UUID scopeID, UUID regionID)
208 { 273 {
209 int flags = m_LocalGridService.GetRegionFlags(scopeID, regionID); 274 int flags = m_LocalGridService.GetRegionFlags(scopeID, regionID);
210 if (flags == -1) 275 if (flags == -1)
211 flags = base.GetRegionFlags(scopeID, regionID); 276 flags = m_RemoteGridService.GetRegionFlags(scopeID, regionID);
212 277
213 return flags; 278 return flags;
214 } 279 }
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
index f8a599a..9ec4ebe 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
@@ -136,14 +136,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver
136 ms.Close(); 136 ms.Close();
137 137
138 m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); 138 m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive.");
139
140 139
141 // Write out scene object metadata 140 // Write out scene object metadata
142 foreach (SceneObjectGroup sceneObject in m_sceneObjects) 141 foreach (SceneObjectGroup sceneObject in m_sceneObjects)
143 { 142 {
144 //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); 143 //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType());
145 144
146 string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options); 145 string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options);
147 m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject); 146 m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject);
148 } 147 }
149 148
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 0699407..f2d487e 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
58 /// <summary> 58 /// <summary>
59 /// The maximum major version of OAR that we can write. 59 /// The maximum major version of OAR that we can write.
60 /// </summary> 60 /// </summary>
61 public static int MAX_MAJOR_VERSION = 1; 61 public static int MAX_MAJOR_VERSION = 0;
62 62
63 protected Scene m_scene; 63 protected Scene m_scene;
64 protected Stream m_saveStream; 64 protected Stream m_saveStream;
@@ -206,37 +206,37 @@ namespace OpenSim.Region.CoreModules.World.Archiver
206 /// <returns></returns> 206 /// <returns></returns>
207 public static string CreateControlFile(Dictionary<string, object> options) 207 public static string CreateControlFile(Dictionary<string, object> options)
208 { 208 {
209 int majorVersion = MAX_MAJOR_VERSION, minorVersion = 0; 209 int majorVersion = MAX_MAJOR_VERSION, minorVersion = 5;
210 210//
211 if (options.ContainsKey("version")) 211// if (options.ContainsKey("version"))
212 { 212// {
213 string[] parts = options["version"].ToString().Split('.'); 213// string[] parts = options["version"].ToString().Split('.');
214 if (parts.Length >= 1) 214// if (parts.Length >= 1)
215 { 215// {
216 majorVersion = Int32.Parse(parts[0]); 216// majorVersion = Int32.Parse(parts[0]);
217 217//
218 if (parts.Length >= 2) 218// if (parts.Length >= 2)
219 minorVersion = Int32.Parse(parts[1]); 219// minorVersion = Int32.Parse(parts[1]);
220 } 220// }
221 } 221// }
222 222//
223 if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION) 223// if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION)
224 { 224// {
225 throw new Exception( 225// throw new Exception(
226 string.Format( 226// string.Format(
227 "OAR version number for save must be between {0} and {1}", 227// "OAR version number for save must be between {0} and {1}",
228 MIN_MAJOR_VERSION, MAX_MAJOR_VERSION)); 228// MIN_MAJOR_VERSION, MAX_MAJOR_VERSION));
229 } 229// }
230 else if (majorVersion == MAX_MAJOR_VERSION) 230// else if (majorVersion == MAX_MAJOR_VERSION)
231 { 231// {
232 // Force 1.0 232// // Force 1.0
233 minorVersion = 0; 233// minorVersion = 0;
234 } 234// }
235 else if (majorVersion == MIN_MAJOR_VERSION) 235// else if (majorVersion == MIN_MAJOR_VERSION)
236 { 236// {
237 // Force 0.4 237// // Force 0.4
238 minorVersion = 4; 238// minorVersion = 4;
239 } 239// }
240 240
241 m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); 241 m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion);
242 //if (majorVersion == 1) 242 //if (majorVersion == 1)
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
index 2d7244e..9277c59 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
@@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
125 Dictionary<string, object> options = new Dictionary<string, object>(); 125 Dictionary<string, object> options = new Dictionary<string, object>();
126 126
127 OptionSet ops = new OptionSet(); 127 OptionSet ops = new OptionSet();
128 ops.Add("v|version=", delegate(string v) { options["version"] = v; }); 128// ops.Add("v|version=", delegate(string v) { options["version"] = v; });
129 ops.Add("p|profile=", delegate(string v) { options["profile"] = v; }); 129 ops.Add("p|profile=", delegate(string v) { options["profile"] = v; });
130 130
131 List<string> mainParams = ops.Parse(cmdparams); 131 List<string> mainParams = ops.Parse(cmdparams);
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 695202f..ac4705c 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -159,7 +159,7 @@ namespace OpenSim.Region.CoreModules.World.Land
159 client.OnParcelSelectObjects += ClientOnParcelSelectObjects; 159 client.OnParcelSelectObjects += ClientOnParcelSelectObjects;
160 client.OnParcelObjectOwnerRequest += ClientOnParcelObjectOwnerRequest; 160 client.OnParcelObjectOwnerRequest += ClientOnParcelObjectOwnerRequest;
161 client.OnParcelAccessListRequest += ClientOnParcelAccessListRequest; 161 client.OnParcelAccessListRequest += ClientOnParcelAccessListRequest;
162 client.OnParcelAccessListUpdateRequest += ClientOnParcelAccessUpdateListRequest; 162 client.OnParcelAccessListUpdateRequest += ClientOnParcelAccessListUpdateRequest;
163 client.OnParcelAbandonRequest += ClientOnParcelAbandonRequest; 163 client.OnParcelAbandonRequest += ClientOnParcelAbandonRequest;
164 client.OnParcelGodForceOwner += ClientOnParcelGodForceOwner; 164 client.OnParcelGodForceOwner += ClientOnParcelGodForceOwner;
165 client.OnParcelReclaim += ClientOnParcelReclaim; 165 client.OnParcelReclaim += ClientOnParcelReclaim;
@@ -508,14 +508,22 @@ namespace OpenSim.Region.CoreModules.World.Land
508 508
509 if (land != null) 509 if (land != null)
510 { 510 {
511 m_landList[landLocalID].SendAccessList(agentID, sessionID, flags, sequenceID, remote_client); 511 land.SendAccessList(agentID, sessionID, flags, sequenceID, remote_client);
512 } 512 }
513 } 513 }
514 514
515 public void ClientOnParcelAccessUpdateListRequest(UUID agentID, UUID sessionID, uint flags, int landLocalID, 515 public void ClientOnParcelAccessListUpdateRequest(UUID agentID,
516 List<ParcelManager.ParcelAccessEntry> entries, 516 uint flags, int landLocalID, UUID transactionID, int sequenceID,
517 IClientAPI remote_client) 517 int sections, List<ParcelManager.ParcelAccessEntry> entries,
518 IClientAPI remote_client)
518 { 519 {
520 // Flags is the list to update, it can mean either the ban or
521 // the access list (WTH is a pass list? Mentioned in ParcelFlags)
522 //
523 // There may be multiple packets, because these can get LONG.
524 // Use transactionID to determine a new chain of packets since
525 // packets may have come in out of sequence and that would be
526 // a big mess if using the sequenceID
519 ILandObject land; 527 ILandObject land;
520 lock (m_landList) 528 lock (m_landList)
521 { 529 {
@@ -524,9 +532,15 @@ namespace OpenSim.Region.CoreModules.World.Land
524 532
525 if (land != null) 533 if (land != null)
526 { 534 {
527 if (agentID == land.LandData.OwnerID) 535 GroupPowers requiredPowers = GroupPowers.LandManageAllowed;
536 if (flags == (uint)AccessList.Ban)
537 requiredPowers = GroupPowers.LandManageBanned;
538
539 if (m_scene.Permissions.CanEditParcelProperties(agentID,
540 land, requiredPowers))
528 { 541 {
529 land.UpdateAccessList(flags, entries, remote_client); 542 land.UpdateAccessList(flags, transactionID, sequenceID,
543 sections, entries, remote_client);
530 } 544 }
531 } 545 }
532 else 546 else
@@ -854,7 +868,7 @@ namespace OpenSim.Region.CoreModules.World.Land
854 868
855 //If we are still here, then they are subdividing within one piece of land 869 //If we are still here, then they are subdividing within one piece of land
856 //Check owner 870 //Check owner
857 if (!m_scene.Permissions.CanEditParcel(attempting_user_id, startLandObject)) 871 if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin))
858 { 872 {
859 return; 873 return;
860 } 874 }
@@ -922,7 +936,7 @@ namespace OpenSim.Region.CoreModules.World.Land
922 { 936 {
923 return; 937 return;
924 } 938 }
925 if (!m_scene.Permissions.CanEditParcel(attempting_user_id, masterLandObject)) 939 if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin))
926 { 940 {
927 return; 941 return;
928 } 942 }
@@ -1570,7 +1584,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1570 1584
1571 if (land == null) return; 1585 if (land == null) return;
1572 1586
1573 if (!m_scene.Permissions.CanEditParcel(remoteClient.AgentId, land)) 1587 if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions))
1574 return; 1588 return;
1575 1589
1576 land.LandData.OtherCleanTime = otherCleanTime; 1590 land.LandData.OtherCleanTime = otherCleanTime;
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index d87352f..3e41c55 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -54,6 +54,7 @@ namespace OpenSim.Region.CoreModules.World.Land
54 protected LandData m_landData = new LandData(); 54 protected LandData m_landData = new LandData();
55 protected Scene m_scene; 55 protected Scene m_scene;
56 protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); 56 protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>();
57 protected Dictionary<uint, UUID> m_listTransactions = new Dictionary<uint, UUID>();
57 58
58 public bool[,] LandBitmap 59 public bool[,] LandBitmap
59 { 60 {
@@ -199,36 +200,81 @@ namespace OpenSim.Region.CoreModules.World.Land
199 200
200 public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client) 201 public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client)
201 { 202 {
202 if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this)) 203 //Needs later group support
204 bool snap_selection = false;
205 LandData newData = LandData.Copy();
206
207 uint allowedDelta = 0;
208
209 // These two are always blocked as no client can set them anyway
210 // ParcelFlags.ForSaleObjects
211 // ParcelFlags.LindenHome
212
213 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions))
203 { 214 {
204 //Needs later group support 215 allowedDelta |= (uint)(ParcelFlags.AllowLandmark |
205 bool snap_selection = false; 216 ParcelFlags.AllowTerraform |
206 LandData newData = LandData.Copy(); 217 ParcelFlags.AllowDamage |
218 ParcelFlags.CreateObjects |
219 ParcelFlags.RestrictPushObject |
220 ParcelFlags.AllowGroupScripts |
221 ParcelFlags.CreateGroupObjects |
222 ParcelFlags.AllowAPrimitiveEntry |
223 ParcelFlags.AllowGroupObjectEntry);
224 }
207 225
208 if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) 226 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale))
227 {
228 if (args.AuthBuyerID != newData.AuthBuyerID ||
229 args.SalePrice != newData.SalePrice)
209 { 230 {
210 if (m_scene.Permissions.CanSellParcel(remote_client.AgentId, this)) 231 snap_selection = true;
211 { 232 }
212 newData.AuthBuyerID = args.AuthBuyerID; 233
213 newData.SalePrice = args.SalePrice; 234 newData.AuthBuyerID = args.AuthBuyerID;
214 snap_selection = true; 235 newData.SalePrice = args.SalePrice;
215 } 236
237 if (!LandData.IsGroupOwned)
238 {
239 newData.GroupID = args.GroupID;
240
241 allowedDelta |= (uint)(ParcelFlags.AllowDeedToGroup |
242 ParcelFlags.ContributeWithDeed |
243 ParcelFlags.SellParcelObjects);
216 } 244 }
245
246 allowedDelta |= (uint)ParcelFlags.ForSale;
247 }
248
249 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.FindPlaces))
250 {
217 newData.Category = args.Category; 251 newData.Category = args.Category;
252
253 allowedDelta |= (uint)(ParcelFlags.ShowDirectory |
254 ParcelFlags.AllowPublish |
255 ParcelFlags.MaturePublish);
256 }
257
258 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity))
259 {
218 newData.Description = args.Desc; 260 newData.Description = args.Desc;
219 newData.GroupID = args.GroupID; 261 newData.Name = args.Name;
262 newData.SnapshotID = args.SnapshotID;
263 }
264
265 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.SetLandingPoint))
266 {
220 newData.LandingType = args.LandingType; 267 newData.LandingType = args.LandingType;
268 newData.UserLocation = args.UserLocation;
269 newData.UserLookAt = args.UserLookAt;
270 }
271
272 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.ChangeMedia))
273 {
221 newData.MediaAutoScale = args.MediaAutoScale; 274 newData.MediaAutoScale = args.MediaAutoScale;
222 newData.MediaID = args.MediaID; 275 newData.MediaID = args.MediaID;
223 newData.MediaURL = args.MediaURL; 276 newData.MediaURL = args.MediaURL;
224 newData.MusicURL = args.MusicURL; 277 newData.MusicURL = args.MusicURL;
225 newData.Name = args.Name;
226 newData.Flags = args.ParcelFlags;
227 newData.PassHours = args.PassHours;
228 newData.PassPrice = args.PassPrice;
229 newData.SnapshotID = args.SnapshotID;
230 newData.UserLocation = args.UserLocation;
231 newData.UserLookAt = args.UserLookAt;
232 newData.MediaType = args.MediaType; 278 newData.MediaType = args.MediaType;
233 newData.MediaDescription = args.MediaDescription; 279 newData.MediaDescription = args.MediaDescription;
234 newData.MediaWidth = args.MediaWidth; 280 newData.MediaWidth = args.MediaWidth;
@@ -237,10 +283,40 @@ namespace OpenSim.Region.CoreModules.World.Land
237 newData.ObscureMusic = args.ObscureMusic; 283 newData.ObscureMusic = args.ObscureMusic;
238 newData.ObscureMedia = args.ObscureMedia; 284 newData.ObscureMedia = args.ObscureMedia;
239 285
240 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); 286 allowedDelta |= (uint)(ParcelFlags.SoundLocal |
287 ParcelFlags.UrlWebPage |
288 ParcelFlags.UrlRawHtml |
289 ParcelFlags.AllowVoiceChat |
290 ParcelFlags.UseEstateVoiceChan);
291 }
292
293 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses))
294 {
295 newData.PassHours = args.PassHours;
296 newData.PassPrice = args.PassPrice;
297
298 allowedDelta |= (uint)ParcelFlags.UsePassList;
299 }
300
301 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageAllowed))
302 {
303 allowedDelta |= (uint)(ParcelFlags.UseAccessGroup |
304 ParcelFlags.UseAccessList);
305 }
241 306
242 SendLandUpdateToAvatarsOverMe(snap_selection); 307 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageBanned))
308 {
309 allowedDelta |= (uint)(ParcelFlags.UseBanList |
310 ParcelFlags.DenyAnonymous |
311 ParcelFlags.DenyAgeUnverified);
243 } 312 }
313
314 uint preserve = LandData.Flags & ~allowedDelta;
315 newData.Flags = preserve | (args.ParcelFlags & allowedDelta);
316
317 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
318
319 SendLandUpdateToAvatarsOverMe(snap_selection);
244 } 320 }
245 321
246 public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) 322 public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area)
@@ -295,14 +371,14 @@ namespace OpenSim.Region.CoreModules.World.Land
295 371
296 if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) 372 if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0)
297 { 373 {
298 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 374 if (LandData.ParcelAccessList.FindIndex(
299 entry.AgentID = avatar; 375 delegate(ParcelManager.ParcelAccessEntry e)
300 entry.Flags = AccessList.Ban; 376 {
301 entry.Time = new DateTime(); 377 if (e.AgentID == avatar && e.Flags == AccessList.Ban)
302 //See if they are on the list, but make sure the owner isn't banned 378 return true;
303 if (LandData.ParcelAccessList.Contains(entry) && LandData.OwnerID != avatar) 379 return false;
380 }) != -1 && LandData.OwnerID != avatar)
304 { 381 {
305 //They are banned, so lets send them a notice about this parcel
306 return true; 382 return true;
307 } 383 }
308 } 384 }
@@ -316,15 +392,14 @@ namespace OpenSim.Region.CoreModules.World.Land
316 392
317 if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) 393 if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0)
318 { 394 {
319 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 395 if (LandData.ParcelAccessList.FindIndex(
320 entry.AgentID = avatar; 396 delegate(ParcelManager.ParcelAccessEntry e)
321 entry.Flags = AccessList.Access; 397 {
322 entry.Time = new DateTime(); 398 if (e.AgentID == avatar && e.Flags == AccessList.Access)
323 399 return true;
324 //If they are not on the access list and are not the owner 400 return false;
325 if (!LandData.ParcelAccessList.Contains(entry) && LandData.OwnerID != avatar) 401 }) == -1 && LandData.OwnerID != avatar)
326 { 402 {
327 //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel
328 return true; 403 return true;
329 } 404 }
330 } 405 }
@@ -421,39 +496,52 @@ namespace OpenSim.Region.CoreModules.World.Land
421 } 496 }
422 } 497 }
423 498
424 public void UpdateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client) 499 public void UpdateAccessList(uint flags, UUID transactionID,
500 int sequenceID, int sections,
501 List<ParcelManager.ParcelAccessEntry> entries,
502 IClientAPI remote_client)
425 { 503 {
426 LandData newData = LandData.Copy(); 504 LandData newData = LandData.Copy();
427 505
428 if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) 506 if ((!m_listTransactions.ContainsKey(flags)) ||
507 m_listTransactions[flags] != transactionID)
429 { 508 {
430 entries.Clear(); 509 m_listTransactions[flags] = transactionID;
431 }
432 510
433 List<ParcelManager.ParcelAccessEntry> toRemove = new List<ParcelManager.ParcelAccessEntry>(); 511 List<ParcelManager.ParcelAccessEntry> toRemove =
434 foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList) 512 new List<ParcelManager.ParcelAccessEntry>();
435 { 513
436 if (entry.Flags == (AccessList)flags) 514 foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList)
437 { 515 {
438 toRemove.Add(entry); 516 if (entry.Flags == (AccessList)flags)
517 toRemove.Add(entry);
439 } 518 }
440 }
441 519
442 foreach (ParcelManager.ParcelAccessEntry entry in toRemove) 520 foreach (ParcelManager.ParcelAccessEntry entry in toRemove)
443 { 521 {
444 newData.ParcelAccessList.Remove(entry); 522 newData.ParcelAccessList.Remove(entry);
523 }
524
525 // Checked here because this will always be the first
526 // and only packet in a transaction
527 if (entries.Count == 1 && entries[0].AgentID == UUID.Zero)
528 {
529 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
530
531 return;
532 }
445 } 533 }
534
446 foreach (ParcelManager.ParcelAccessEntry entry in entries) 535 foreach (ParcelManager.ParcelAccessEntry entry in entries)
447 { 536 {
448 ParcelManager.ParcelAccessEntry temp = new ParcelManager.ParcelAccessEntry(); 537 ParcelManager.ParcelAccessEntry temp =
538 new ParcelManager.ParcelAccessEntry();
539
449 temp.AgentID = entry.AgentID; 540 temp.AgentID = entry.AgentID;
450 temp.Time = new DateTime(); //Pointless? Yes. 541 temp.Time = entry.Time;
451 temp.Flags = (AccessList)flags; 542 temp.Flags = (AccessList)flags;
452 543
453 if (!newData.ParcelAccessList.Contains(temp)) 544 newData.ParcelAccessList.Add(temp);
454 {
455 newData.ParcelAccessList.Add(temp);
456 }
457 } 545 }
458 546
459 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); 547 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
@@ -711,7 +799,7 @@ namespace OpenSim.Region.CoreModules.World.Land
711 799
712 public void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client) 800 public void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client)
713 { 801 {
714 if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this)) 802 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions))
715 { 803 {
716 List<uint> resultLocalIDs = new List<uint>(); 804 List<uint> resultLocalIDs = new List<uint>();
717 try 805 try
@@ -761,7 +849,7 @@ namespace OpenSim.Region.CoreModules.World.Land
761 /// </param> 849 /// </param>
762 public void SendLandObjectOwners(IClientAPI remote_client) 850 public void SendLandObjectOwners(IClientAPI remote_client)
763 { 851 {
764 if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this)) 852 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions))
765 { 853 {
766 Dictionary<UUID, int> primCount = new Dictionary<UUID, int>(); 854 Dictionary<UUID, int> primCount = new Dictionary<UUID, int>();
767 List<UUID> groups = new List<UUID>(); 855 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 f5f3839..364dd6c 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -37,56 +37,6 @@ using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
38using OpenSim.Services.Interfaces; 38using OpenSim.Services.Interfaces;
39 39
40// Temporary fix of wrong GroupPowers constants in OpenMetaverse library
41enum GroupPowers : long
42 {
43 None = 0,
44 LandEjectAndFreeze = 1,
45 Invite = 2,
46 ReturnGroupSet = 2,
47 Eject = 4,
48 ReturnNonGroup = 4,
49 ChangeOptions = 8,
50 LandGardening = 8,
51 CreateRole = 16,
52 DeedObject = 16,
53 ModerateChat = 32,
54 DeleteRole = 32,
55 RoleProperties = 64,
56 ObjectManipulate = 64,
57 ObjectSetForSale = 128,
58 AssignMemberLimited = 128,
59 AssignMember = 256,
60 Accountable = 256,
61 RemoveMember = 512,
62 SendNotices = 1024,
63 ChangeActions = 1024,
64 ChangeIdentity = 2048,
65 ReceiveNotices = 2048,
66 StartProposal = 4096,
67 LandDeed = 4096,
68 VoteOnProposal = 8192,
69 LandRelease = 8192,
70 LandSetSale = 16384,
71 LandDivideJoin = 32768,
72 ReturnGroupOwned = 65536,
73 JoinChat = 65536,
74 FindPlaces = 131072,
75 LandChangeIdentity = 262144,
76 SetLandingPoint = 524288,
77 ChangeMedia = 1048576,
78 LandEdit = 2097152,
79 LandOptions = 4194304,
80 AllowEditLand = 8388608,
81 AllowFly = 16777216,
82 AllowRez = 33554432,
83 AllowLandmark = 67108864,
84 AllowVoiceChat = 134217728,
85 AllowSetHome = 268435456,
86 LandManageAllowed = 536870912,
87 LandManageBanned = 1073741824
88 }
89
90namespace OpenSim.Region.CoreModules.World.Permissions 40namespace OpenSim.Region.CoreModules.World.Permissions
91{ 41{
92 public class PermissionsModule : IRegionModule 42 public class PermissionsModule : IRegionModule
@@ -214,7 +164,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
214 m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; 164 m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
215 m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED 165 m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED
216 m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED 166 m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED
217 m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED 167 m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties; //MAYBE FULLY IMPLEMENTED
218 m_scene.Permissions.OnInstantMessage += CanInstantMessage; 168 m_scene.Permissions.OnInstantMessage += CanInstantMessage;
219 m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED 169 m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED
220 m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED 170 m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED
@@ -1005,12 +955,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1005 return GenericObjectPermission(editorID, objectID, false); 955 return GenericObjectPermission(editorID, objectID, false);
1006 } 956 }
1007 957
1008 private bool CanEditParcel(UUID user, ILandObject parcel, Scene scene) 958 private bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, Scene scene)
1009 { 959 {
1010 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 960 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1011 if (m_bypassPermissions) return m_bypassPermissionsValue; 961 if (m_bypassPermissions) return m_bypassPermissionsValue;
1012 962
1013 return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandDivideJoin); 963 return GenericParcelOwnerPermission(user, parcel, (ulong)p);
1014 } 964 }
1015 965
1016 /// <summary> 966 /// <summary>
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index 9f88517..bdd1a0b 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -93,13 +93,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
93 } 93 }
94 94
95 // try to fetch from GridServer 95 // try to fetch from GridServer
96 List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(UUID.Zero, mapName, 20); 96 List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
97 if (regionInfos == null) 97 if (regionInfos == null)
98 { 98 {
99 m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?"); 99 m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?");
100 // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region 100 // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region
101 regionInfos = new List<GridRegion>(); 101 regionInfos = new List<GridRegion>();
102 GridRegion info = m_scene.GridService.GetRegionByName(UUID.Zero, mapName); 102 GridRegion info = m_scene.GridService.GetRegionByName(m_scene.RegionInfo.ScopeID, mapName);
103 if (info != null) regionInfos.Add(info); 103 if (info != null) regionInfos.Add(info);
104 } 104 }
105 105
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 9869f4a..e3ba190 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -33,6 +33,7 @@ using System.Drawing.Imaging;
33using System.IO; 33using System.IO;
34using System.Net; 34using System.Net;
35using System.Reflection; 35using System.Reflection;
36using System.Runtime.Remoting.Messaging;
36using System.Threading; 37using System.Threading;
37using log4net; 38using log4net;
38using Nini.Config; 39using Nini.Config;
@@ -413,11 +414,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
413 } 414 }
414 } 415 }
415 416
417 private int nAsyncRequests = 0;
416 /// <summary> 418 /// <summary>
417 /// Processing thread main() loop for doing remote mapitem requests 419 /// Processing thread main() loop for doing remote mapitem requests
418 /// </summary> 420 /// </summary>
419 public void process() 421 public void process()
420 { 422 {
423 const int MAX_ASYNC_REQUESTS = 20;
421 try 424 try
422 { 425 {
423 while (true) 426 while (true)
@@ -437,10 +440,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
437 dorequest = false; 440 dorequest = false;
438 } 441 }
439 442
440 if (dorequest) 443 if (dorequest && !m_blacklistedregions.ContainsKey(st.regionhandle))
441 { 444 {
442 OSDMap response = RequestMapItemsAsync("", st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle); 445 while (nAsyncRequests >= MAX_ASYNC_REQUESTS) // hit the break
443 RequestMapItemsCompleted(response); 446 Thread.Sleep(80);
447
448 RequestMapItemsDelegate d = RequestMapItemsAsync;
449 d.BeginInvoke(st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle, RequestMapItemsCompleted, null);
450 //OSDMap response = RequestMapItemsAsync(st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle);
451 //RequestMapItemsCompleted(response);
452 Interlocked.Increment(ref nAsyncRequests);
444 } 453 }
445 } 454 }
446 455
@@ -469,8 +478,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
469 /// Sends the mapitem response to the IClientAPI 478 /// Sends the mapitem response to the IClientAPI
470 /// </summary> 479 /// </summary>
471 /// <param name="response">The OSDMap Response for the mapitem</param> 480 /// <param name="response">The OSDMap Response for the mapitem</param>
472 private void RequestMapItemsCompleted(OSDMap response) 481 private void RequestMapItemsCompleted(IAsyncResult iar)
473 { 482 {
483 AsyncResult result = (AsyncResult)iar;
484 RequestMapItemsDelegate icon = (RequestMapItemsDelegate)result.AsyncDelegate;
485
486 OSDMap response = (OSDMap)icon.EndInvoke(iar);
487
488 Interlocked.Decrement(ref nAsyncRequests);
489
490 if (!response.ContainsKey("requestID"))
491 return;
492
474 UUID requestID = response["requestID"].AsUUID(); 493 UUID requestID = response["requestID"].AsUUID();
475 494
476 if (requestID != UUID.Zero) 495 if (requestID != UUID.Zero)
@@ -538,6 +557,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
538 EnqueueMapItemRequest(st); 557 EnqueueMapItemRequest(st);
539 } 558 }
540 559
560 private delegate OSDMap RequestMapItemsDelegate(UUID id, uint flags,
561 uint EstateID, bool godlike, uint itemtype, ulong regionhandle);
541 /// <summary> 562 /// <summary>
542 /// Does the actual remote mapitem request 563 /// Does the actual remote mapitem request
543 /// This should be called from an asynchronous thread 564 /// This should be called from an asynchronous thread
@@ -552,9 +573,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
552 /// <param name="itemtype">passed in from packet</param> 573 /// <param name="itemtype">passed in from packet</param>
553 /// <param name="regionhandle">Region we're looking up</param> 574 /// <param name="regionhandle">Region we're looking up</param>
554 /// <returns></returns> 575 /// <returns></returns>
555 private OSDMap RequestMapItemsAsync(string httpserver, UUID id, uint flags, 576 private OSDMap RequestMapItemsAsync(UUID id, uint flags,
556 uint EstateID, bool godlike, uint itemtype, ulong regionhandle) 577 uint EstateID, bool godlike, uint itemtype, ulong regionhandle)
557 { 578 {
579 string httpserver = "";
558 bool blacklisted = false; 580 bool blacklisted = false;
559 lock (m_blacklistedregions) 581 lock (m_blacklistedregions)
560 { 582 {
@@ -593,7 +615,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
593 if (!m_blacklistedregions.ContainsKey(regionhandle)) 615 if (!m_blacklistedregions.ContainsKey(regionhandle))
594 m_blacklistedregions.Add(regionhandle, Environment.TickCount); 616 m_blacklistedregions.Add(regionhandle, Environment.TickCount);
595 } 617 }
596 m_log.InfoFormat("[WORLD MAP]: Blacklisted region {0}", regionhandle.ToString()); 618 //m_log.InfoFormat("[WORLD MAP]: Blacklisted region {0}", regionhandle.ToString());
597 } 619 }
598 } 620 }
599 621
@@ -638,7 +660,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
638 os = mapitemsrequest.GetRequestStream(); 660 os = mapitemsrequest.GetRequestStream();
639 os.Write(buffer, 0, buffer.Length); //Send it 661 os.Write(buffer, 0, buffer.Length); //Send it
640 os.Close(); 662 os.Close();
641 //m_log.DebugFormat("[WORLD MAP]: Getting MapItems from Sim {0}", httpserver); 663 //m_log.DebugFormat("[WORLD MAP]: Getting MapItems from {0}", httpserver);
642 } 664 }
643 catch (WebException ex) 665 catch (WebException ex)
644 { 666 {
@@ -654,15 +676,22 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
654 676
655 return responseMap; 677 return responseMap;
656 } 678 }
679 catch
680 {
681 m_log.DebugFormat("[WORLD MAP]: RequestMapItems failed for {0}", httpserver);
682 responseMap["connect"] = OSD.FromBoolean(false);
683 return responseMap;
684 }
657 685
658 string response_mapItems_reply = null; 686 string response_mapItems_reply = null;
659 { // get the response 687 { // get the response
688 StreamReader sr = null;
660 try 689 try
661 { 690 {
662 WebResponse webResponse = mapitemsrequest.GetResponse(); 691 WebResponse webResponse = mapitemsrequest.GetResponse();
663 if (webResponse != null) 692 if (webResponse != null)
664 { 693 {
665 StreamReader sr = new StreamReader(webResponse.GetResponseStream()); 694 sr = new StreamReader(webResponse.GetResponseStream());
666 response_mapItems_reply = sr.ReadToEnd().Trim(); 695 response_mapItems_reply = sr.ReadToEnd().Trim();
667 } 696 }
668 else 697 else
@@ -683,6 +712,24 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
683 712
684 return responseMap; 713 return responseMap;
685 } 714 }
715 catch
716 {
717 m_log.DebugFormat("[WORLD MAP]: RequestMapItems failed for {0}", httpserver);
718 responseMap["connect"] = OSD.FromBoolean(false);
719 lock (m_blacklistedregions)
720 {
721 if (!m_blacklistedregions.ContainsKey(regionhandle))
722 m_blacklistedregions.Add(regionhandle, Environment.TickCount);
723 }
724
725 return responseMap;
726 }
727 finally
728 {
729 if (sr != null)
730 sr.Close();
731 }
732
686 OSD rezResponse = null; 733 OSD rezResponse = null;
687 try 734 try
688 { 735 {
@@ -691,14 +738,29 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
691 responseMap = (OSDMap)rezResponse; 738 responseMap = (OSDMap)rezResponse;
692 responseMap["requestID"] = OSD.FromUUID(requestID); 739 responseMap["requestID"] = OSD.FromUUID(requestID);
693 } 740 }
694 catch (Exception) 741 catch (Exception ex)
695 { 742 {
696 //m_log.InfoFormat("[OGP]: exception on parse of rez reply {0}", ex.Message); 743 m_log.InfoFormat("[WORLD MAP]: exception on parse of RequestMapItems reply from {0}: {1}", httpserver, ex.Message);
697 responseMap["connect"] = OSD.FromBoolean(false); 744 responseMap["connect"] = OSD.FromBoolean(false);
745 lock (m_blacklistedregions)
746 {
747 if (!m_blacklistedregions.ContainsKey(regionhandle))
748 m_blacklistedregions.Add(regionhandle, Environment.TickCount);
749 }
698 750
699 return responseMap; 751 return responseMap;
700 } 752 }
701 } 753 }
754
755 if (!responseMap.ContainsKey(itemtype.ToString())) // remote sim doesnt have the stated region handle
756 {
757 if (!m_blacklistedregions.ContainsKey(regionhandle))
758 {
759 m_log.DebugFormat("[WORLD MAP]: Remote sim does not have the stated region. Blacklisting.");
760 m_blacklistedregions.Add(regionhandle, Environment.TickCount);
761 }
762 }
763
702 return responseMap; 764 return responseMap;
703 } 765 }
704 766
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index b3576c5..6cc64c6 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -113,15 +113,18 @@ namespace OpenSim.Region.Framework.Interfaces
113 /// <summary> 113 /// <summary>
114 /// Update the user inventory to show a detach. 114 /// Update the user inventory to show a detach.
115 /// </summary> 115 /// </summary>
116 /// <param name="itemID"> 116 /// <param name="itemID">/param>
117 /// A <see cref="UUID"/> 117 /// <param name="remoteClient"></param>
118 /// </param>
119 /// <param name="remoteClient">
120 /// A <see cref="IClientAPI"/>
121 /// </param>
122 void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient); 118 void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient);
123 119
124 /// <summary> 120 /// <summary>
121 /// Update the position of an attachment.
122 /// </summary>
123 /// <param name="sog"></param>
124 /// <param name="pos"></param>
125 void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos);
126
127 /// <summary>
125 /// Update the user inventory with a changed attachment 128 /// Update the user inventory with a changed attachment
126 /// </summary> 129 /// </summary>
127 /// <param name="remoteClient"> 130 /// <param name="remoteClient">
diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
index 084184f..585eb00 100644
--- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs
+++ b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Interfaces
57 void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client); 57 void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client);
58 List<UUID> CreateAccessListArrayByFlag(AccessList flag); 58 List<UUID> CreateAccessListArrayByFlag(AccessList flag);
59 void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); 59 void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client);
60 void UpdateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client); 60 void UpdateAccessList(uint flags, UUID transactionID, int sequenceID, int sections, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client);
61 void UpdateLandBitmapByteArray(); 61 void UpdateLandBitmapByteArray();
62 void SetLandBitmapFromByteArray(); 62 void SetLandBitmapFromByteArray();
63 bool[,] GetLandBitmap(); 63 bool[,] GetLandBitmap();
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index a90e0f3..4865481 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -233,6 +233,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
233 // Falling long enough to trigger the animation 233 // Falling long enough to trigger the animation
234 return "FALLDOWN"; 234 return "FALLDOWN";
235 } 235 }
236 else if (m_animTickJump == -1)
237 {
238 m_animTickJump = 0;
239 return "STAND";
240 }
236 241
237 return m_movementAnimation; 242 return m_movementAnimation;
238 } 243 }
@@ -279,6 +284,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
279 m_animTickJump = -1; 284 m_animTickJump = -1;
280 return "JUMP"; 285 return "JUMP";
281 } 286 }
287 else
288 return "JUMP";
282 } 289 }
283 else 290 else
284 { 291 {
@@ -307,7 +314,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
307 314
308 #endregion Ground Movement 315 #endregion Ground Movement
309 316
310 return m_movementAnimation; 317 //return m_movementAnimation;
311 } 318 }
312 319
313 /// <summary> 320 /// <summary>
@@ -316,16 +323,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
316 public void UpdateMovementAnimations() 323 public void UpdateMovementAnimations()
317 { 324 {
318 m_movementAnimation = GetMovementAnimation(); 325 m_movementAnimation = GetMovementAnimation();
319 326 TrySetMovementAnimation(m_movementAnimation);
320 if (m_movementAnimation == "PREJUMP" && !m_scenePresence.Scene.m_usePreJump)
321 {
322 // This was the previous behavior before PREJUMP
323 TrySetMovementAnimation("JUMP");
324 }
325 else
326 {
327 TrySetMovementAnimation(m_movementAnimation);
328 }
329 } 327 }
330 328
331 public UUID[] GetAnimationArray() 329 public UUID[] GetAnimationArray()
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index 19f8180..f9599f5 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -218,20 +218,28 @@ namespace OpenSim.Region.Framework.Scenes
218 218
219 private double GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity) 219 private double GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity)
220 { 220 {
221 ScenePresence presence = m_scene.GetScenePresence(client.AgentId); 221 // If this is an update for our own avatar give it the highest priority
222 if (presence != null) 222 if (client.AgentId == entity.UUID)
223 { 223 return 0.0;
224 // If this is an update for our own avatar give it the highest priority 224 if (entity == null)
225 if (presence == entity) 225 return double.NaN;
226 return 0.0;
227 226
228 // Use group position for child prims 227 // Use group position for child prims
229 Vector3 entityPos = entity.AbsolutePosition; 228 Vector3 entityPos = entity.AbsolutePosition;
230 if (entity is SceneObjectPart) 229 if (entity is SceneObjectPart)
231 entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; 230 {
231 SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup;
232 if (group != null)
233 entityPos = group.AbsolutePosition;
232 else 234 else
233 entityPos = entity.AbsolutePosition; 235 entityPos = entity.AbsolutePosition;
236 }
237 else
238 entityPos = entity.AbsolutePosition;
234 239
240 ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
241 if (presence != null)
242 {
235 if (!presence.IsChildAgent) 243 if (!presence.IsChildAgent)
236 { 244 {
237 if (entity is ScenePresence) 245 if (entity is ScenePresence)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index d67638a..1295e58 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -68,6 +68,7 @@ namespace OpenSim.Region.Framework.Scenes
68 public delegate bool IsGodHandler(UUID user, Scene requestFromScene); 68 public delegate bool IsGodHandler(UUID user, Scene requestFromScene);
69 public delegate bool IsAdministratorHandler(UUID user); 69 public delegate bool IsAdministratorHandler(UUID user);
70 public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); 70 public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene);
71 public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene);
71 public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); 72 public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene);
72 public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene); 73 public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene);
73 public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene); 74 public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene);
@@ -131,6 +132,7 @@ namespace OpenSim.Region.Framework.Scenes
131 public event IsGodHandler OnIsGod; 132 public event IsGodHandler OnIsGod;
132 public event IsAdministratorHandler OnIsAdministrator; 133 public event IsAdministratorHandler OnIsAdministrator;
133 public event EditParcelHandler OnEditParcel; 134 public event EditParcelHandler OnEditParcel;
135 public event EditParcelPropertiesHandler OnEditParcelProperties;
134 public event SellParcelHandler OnSellParcel; 136 public event SellParcelHandler OnSellParcel;
135 public event AbandonParcelHandler OnAbandonParcel; 137 public event AbandonParcelHandler OnAbandonParcel;
136 public event ReclaimParcelHandler OnReclaimParcel; 138 public event ReclaimParcelHandler OnReclaimParcel;
@@ -720,15 +722,16 @@ namespace OpenSim.Region.Framework.Scenes
720 #endregion 722 #endregion
721 723
722 #region EDIT PARCEL 724 #region EDIT PARCEL
723 public bool CanEditParcel(UUID user, ILandObject parcel) 725
726 public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p)
724 { 727 {
725 EditParcelHandler handler = OnEditParcel; 728 EditParcelPropertiesHandler handler = OnEditParcelProperties;
726 if (handler != null) 729 if (handler != null)
727 { 730 {
728 Delegate[] list = handler.GetInvocationList(); 731 Delegate[] list = handler.GetInvocationList();
729 foreach (EditParcelHandler h in list) 732 foreach (EditParcelPropertiesHandler h in list)
730 { 733 {
731 if (h(user, parcel, m_scene) == false) 734 if (h(user, parcel, p, m_scene) == false)
732 return false; 735 return false;
733 } 736 }
734 } 737 }
@@ -1043,4 +1046,4 @@ namespace OpenSim.Region.Framework.Scenes
1043 return true; 1046 return true;
1044 } 1047 }
1045 } 1048 }
1046} \ No newline at end of file 1049}
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 032c859..a2ed54f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -215,7 +215,7 @@ namespace OpenSim.Region.Framework.Scenes
215 SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID); 215 SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID);
216 if (sop != null) 216 if (sop != null)
217 { 217 {
218 coarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition); 218 coarseLocations.Add(sop.AbsolutePosition + sp.OffsetPosition);
219 avatarUUIDs.Add(sp.UUID); 219 avatarUUIDs.Add(sp.UUID);
220 } 220 }
221 else 221 else
@@ -1281,13 +1281,8 @@ namespace OpenSim.Region.Framework.Scenes
1281 { 1281 {
1282 if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0)) 1282 if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0))
1283 { 1283 {
1284 // Set the new attachment point data in the object 1284 if (m_parentScene.AttachmentsModule != null)
1285 byte attachmentPoint = group.GetAttachmentPoint(); 1285 m_parentScene.AttachmentsModule.UpdateAttachmentPosition(group, pos);
1286 group.UpdateGroupPosition(pos);
1287 group.RootPart.IsAttachment = false;
1288 group.AbsolutePosition = group.RootPart.AttachedPos;
1289 group.SetAttachmentPoint(attachmentPoint);
1290 group.HasGroupChanged = true;
1291 } 1286 }
1292 else 1287 else
1293 { 1288 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index f87056e..4fcd8f5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3251,13 +3251,6 @@ namespace OpenSim.Region.Framework.Scenes
3251 //} 3251 //}
3252 } 3252 }
3253 3253
3254 public void SetAvatarOnSitTarget(UUID avatarID)
3255 {
3256 m_sitTargetAvatar = avatarID;
3257 if (ParentGroup != null)
3258 ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
3259 }
3260
3261 public void SetAxisRotation(int axis, int rotate) 3254 public void SetAxisRotation(int axis, int rotate)
3262 { 3255 {
3263 if (m_parentGroup != null) 3256 if (m_parentGroup != null)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a1c80e5..62d7011 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1703,7 +1703,8 @@ namespace OpenSim.Region.Framework.Scenes
1703 } 1703 }
1704 // Reset sit target. 1704 // Reset sit target.
1705 if (part.GetAvatarOnSitTarget() == UUID) 1705 if (part.GetAvatarOnSitTarget() == UUID)
1706 part.SetAvatarOnSitTarget(UUID.Zero); 1706 part.SitTargetAvatar = UUID.Zero;
1707 part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
1707 1708
1708 m_parentPosition = part.GetWorldPosition(); 1709 m_parentPosition = part.GetWorldPosition();
1709 ControllingClient.SendClearFollowCamProperties(part.ParentUUID); 1710 ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
@@ -1807,11 +1808,12 @@ namespace OpenSim.Region.Framework.Scenes
1807 1808
1808 if (SitTargetisSet && SitTargetUnOccupied) 1809 if (SitTargetisSet && SitTargetUnOccupied)
1809 { 1810 {
1810 part.SetAvatarOnSitTarget(UUID); 1811 part.SitTargetAvatar = UUID;
1811 offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z); 1812 offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z);
1812 sitOrientation = avSitOrientation; 1813 sitOrientation = avSitOrientation;
1813 autopilot = false; 1814 autopilot = false;
1814 } 1815 }
1816 part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
1815 1817
1816 pos = part.AbsolutePosition + offset; 1818 pos = part.AbsolutePosition + offset;
1817 //if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1) 1819 //if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1)
@@ -2225,33 +2227,6 @@ namespace OpenSim.Region.Framework.Scenes
2225 { 2227 {
2226 // WHAT??? 2228 // WHAT???
2227 m_log.Debug("[SCENEPRESENCE]: AddNewMovement() called on child agent, making root agent!"); 2229 m_log.Debug("[SCENEPRESENCE]: AddNewMovement() called on child agent, making root agent!");
2228
2229 // we have to reset the user's child agent connections.
2230 // Likely, here they've lost the eventqueue for other regions so border
2231 // crossings will fail at this point unless we reset them.
2232
2233 List<ulong> regions = new List<ulong>(KnownChildRegionHandles);
2234 regions.Remove(m_scene.RegionInfo.RegionHandle);
2235
2236 MakeRootAgent(new Vector3(127f, 127f, 127f), true);
2237
2238 // Async command
2239 if (m_scene.SceneGridService != null)
2240 {
2241 m_scene.SceneGridService.SendCloseChildAgentConnections(UUID, regions);
2242
2243 // Give the above command some time to try and close the connections.
2244 // this is really an emergency.. so sleep, or we'll get all discombobulated.
2245 System.Threading.Thread.Sleep(500);
2246 }
2247
2248 if (m_scene.SceneGridService != null)
2249 {
2250 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
2251 if (m_agentTransfer != null)
2252 m_agentTransfer.EnableChildAgents(this);
2253 }
2254
2255 return; 2230 return;
2256 } 2231 }
2257 2232
@@ -3226,8 +3201,11 @@ namespace OpenSim.Region.Framework.Scenes
3226 Vector3 force = m_forceToApply.Value; 3201 Vector3 force = m_forceToApply.Value;
3227 3202
3228 m_updateflag = true; 3203 m_updateflag = true;
3229// movementvector = force; 3204
3230 Velocity = force; 3205 // The magic constant 0.855f seems to make walking feel less jerky,
3206 // probably because it hackishly accounts for the overall latency of
3207 // these Velocity updates -- Diva
3208 Velocity = force * .855F;
3231 3209
3232 m_forceToApply = null; 3210 m_forceToApply = null;
3233 } 3211 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
index b3b99f4..39116b6 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
@@ -43,13 +43,14 @@ using OpenSim.Tests.Common.Setup;
43namespace OpenSim.Region.Framework.Scenes.Tests 43namespace OpenSim.Region.Framework.Scenes.Tests
44{ 44{
45 /// <summary> 45 /// <summary>
46 /// Tests manipulation of scene objects by users. 46 /// Tests derez of scene objects by users.
47 /// </summary> 47 /// </summary>
48 /// 48 /// <remarks>
49 /// This is at a level above the SceneObjectBasicTests, which act on the scene directly. 49 /// This is at a level above the SceneObjectBasicTests, which act on the scene directly.
50 /// FIXME: These tests are very incomplete - they only test for a few conditions. 50 /// TODO: These tests are very incomplete - they only test for a few conditions.
51 /// </remarks>
51 [TestFixture] 52 [TestFixture]
52 public class SceneObjectUserTests 53 public class SceneObjectDeRezTests
53 { 54 {
54 /// <summary> 55 /// <summary>
55 /// Test deleting an object from a scene. 56 /// Test deleting an object from a scene.
@@ -122,6 +123,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
122 scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); 123 scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero);
123 sogd.InventoryDeQueueAndDelete(); 124 sogd.InventoryDeQueueAndDelete();
124 125
126 // Object should still be in the scene.
125 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 127 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
126 Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); 128 Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID));
127 } 129 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
new file mode 100644
index 0000000..c78038f
--- /dev/null
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
@@ -0,0 +1,87 @@
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.Reflection;
31using Nini.Config;
32using NUnit.Framework;
33using NUnit.Framework.SyntaxHelpers;
34using OpenMetaverse;
35using OpenSim.Framework;
36using OpenSim.Framework.Communications;
37using OpenSim.Region.CoreModules.Avatar.InstantMessage;
38using OpenSim.Region.CoreModules.World.Permissions;
39using OpenSim.Region.Framework.Interfaces;
40using OpenSim.Region.Framework.Scenes;
41using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups;
42using OpenSim.Tests.Common;
43using OpenSim.Tests.Common.Mock;
44using OpenSim.Tests.Common.Setup;
45
46namespace OpenSim.Region.Framework.Scenes.Tests
47{
48 [TestFixture]
49 public class SceneObjectUserGroupTests
50 {
51 /// <summary>
52 /// Test share with group object functionality
53 /// </summary>
54 /// <remarks>This test is not yet fully implemented</remarks>
55 [Test]
56 public void TestShareWithGroup()
57 {
58 TestHelper.InMethod();
59// log4net.Config.XmlConfigurator.Configure();
60
61 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
62
63 TestScene scene = SceneSetupHelpers.SetupScene();
64 IConfigSource configSource = new IniConfigSource();
65
66 IConfig startupConfig = configSource.AddConfig("Startup");
67 startupConfig.Set("serverside_object_permissions", true);
68
69 IConfig groupsConfig = configSource.AddConfig("Groups");
70 groupsConfig.Set("Enabled", true);
71 groupsConfig.Set("Module", "GroupsModule");
72 groupsConfig.Set("DebugEnabled", true);
73
74 SceneSetupHelpers.SetupSceneModules(
75 scene, configSource, new object[]
76 { new PermissionsModule(),
77 new GroupsModule(),
78 new MockGroupsServicesConnector() });
79
80 TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId);
81
82 IGroupsModule groupsModule = scene.RequestModuleInterface<IGroupsModule>();
83
84 groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true);
85 }
86 }
87} \ No newline at end of file
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index ccf5289..4aab87f 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -163,9 +163,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
163 if (m_msgTransferModule == null) 163 if (m_msgTransferModule == null)
164 { 164 {
165 m_groupsEnabled = false; 165 m_groupsEnabled = false;
166 m_log.Error("[GROUPS]: Could not get MessageTransferModule"); 166 m_log.Warn("[GROUPS]: Could not get MessageTransferModule");
167 Close();
168 return;
169 } 167 }
170 } 168 }
171 169
@@ -1299,7 +1297,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1299 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: MsgTo ({0}) is local, delivering directly", localClient.Name); 1297 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: MsgTo ({0}) is local, delivering directly", localClient.Name);
1300 localClient.SendInstantMessage(msg); 1298 localClient.SendInstantMessage(msg);
1301 } 1299 }
1302 else 1300 else if (m_msgTransferModule != null)
1303 { 1301 {
1304 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: MsgTo ({0}) is not local, delivering via TransferModule", msgTo); 1302 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: MsgTo ({0}) is not local, delivering via TransferModule", msgTo);
1305 m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: Message Sent: {0}", success?"Succeeded":"Failed"); }); 1303 m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: Message Sent: {0}", success?"Succeeded":"Failed"); });
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs
index a046e09..5c779de 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs
@@ -27,14 +27,12 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30
31using OpenMetaverse; 30using OpenMetaverse;
32
33using OpenSim.Framework; 31using OpenSim.Framework;
34 32
35namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups 33namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
36{ 34{
37 interface IGroupsServicesConnector 35 public interface IGroupsServicesConnector
38 { 36 {
39 UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID); 37 UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID);
40 void UpdateGroup(UUID RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish); 38 void UpdateGroup(UUID RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish);
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
new file mode 100644
index 0000000..bc55b04
--- /dev/null
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
@@ -0,0 +1,65 @@
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.Reflection;
30using Nini.Config;
31using NUnit.Framework;
32using NUnit.Framework.SyntaxHelpers;
33using OpenMetaverse;
34using OpenSim.Framework;
35using OpenSim.Framework.Communications;
36using OpenSim.Region.Framework.Scenes;
37using OpenSim.Tests.Common;
38using OpenSim.Tests.Common.Mock;
39using OpenSim.Tests.Common.Setup;
40
41namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
42{
43 /// <summary>
44 /// Basic groups module tests
45 /// </summary>
46 [TestFixture]
47 public class GroupsModuleTests
48 {
49 [Test]
50 public void TestBasic()
51 {
52 TestHelper.InMethod();
53// log4net.Config.XmlConfigurator.Configure();
54
55 TestScene scene = SceneSetupHelpers.SetupScene();
56 IConfigSource configSource = new IniConfigSource();
57 IConfig config = configSource.AddConfig("Groups");
58 config.Set("Enabled", true);
59 config.Set("Module", "GroupsModule");
60 config.Set("DebugEnabled", true);
61 SceneSetupHelpers.SetupSceneModules(
62 scene, configSource, new object[] { new MockGroupsServicesConnector() });
63 }
64 }
65} \ No newline at end of file
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 3386e72..211a0a7 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -311,7 +311,7 @@ namespace OpenSim.Region.Physics.Meshing
311 OSD decodedMeshOsd = new OSD(); 311 OSD decodedMeshOsd = new OSD();
312 byte[] meshBytes = new byte[physSize]; 312 byte[] meshBytes = new byte[physSize];
313 System.Buffer.BlockCopy(primShape.SculptData, physOffset, meshBytes, 0, physSize); 313 System.Buffer.BlockCopy(primShape.SculptData, physOffset, meshBytes, 0, physSize);
314 byte[] decompressed = new byte[physSize * 5]; 314// byte[] decompressed = new byte[physSize * 5];
315 try 315 try
316 { 316 {
317 using (MemoryStream inMs = new MemoryStream(meshBytes)) 317 using (MemoryStream inMs = new MemoryStream(meshBytes))
diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs
index e58eb89..4a7f3ad 100644
--- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs
+++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs
@@ -375,7 +375,7 @@ namespace PrimMesher
375 375
376 int coordsDown = rows.Count; 376 int coordsDown = rows.Count;
377 int coordsAcross = rows[0].Count; 377 int coordsAcross = rows[0].Count;
378 int lastColumn = coordsAcross - 1; 378// int lastColumn = coordsAcross - 1;
379 379
380 float widthUnit = 1.0f / (coordsAcross - 1); 380 float widthUnit = 1.0f / (coordsAcross - 1);
381 float heightUnit = 1.0f / (coordsDown - 1); 381 float heightUnit = 1.0f / (coordsDown - 1);
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
index ff0e743..4a24c7d 100644
--- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
+++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
@@ -1001,7 +1001,7 @@ namespace OpenSim.Region.RegionCombinerModule
1001 VirtualRegion.Permissions.OnDuplicateObject += BigRegion.PermissionModule.CanDuplicateObject; 1001 VirtualRegion.Permissions.OnDuplicateObject += BigRegion.PermissionModule.CanDuplicateObject;
1002 VirtualRegion.Permissions.OnDeleteObject += BigRegion.PermissionModule.CanDeleteObject; //MAYBE FULLY IMPLEMENTED 1002 VirtualRegion.Permissions.OnDeleteObject += BigRegion.PermissionModule.CanDeleteObject; //MAYBE FULLY IMPLEMENTED
1003 VirtualRegion.Permissions.OnEditObject += BigRegion.PermissionModule.CanEditObject; //MAYBE FULLY IMPLEMENTED 1003 VirtualRegion.Permissions.OnEditObject += BigRegion.PermissionModule.CanEditObject; //MAYBE FULLY IMPLEMENTED
1004 VirtualRegion.Permissions.OnEditParcel += BigRegion.PermissionModule.CanEditParcel; //MAYBE FULLY IMPLEMENTED 1004 VirtualRegion.Permissions.OnEditParcelProperties += BigRegion.PermissionModule.CanEditParcelProperties; //MAYBE FULLY IMPLEMENTED
1005 VirtualRegion.Permissions.OnInstantMessage += BigRegion.PermissionModule.CanInstantMessage; 1005 VirtualRegion.Permissions.OnInstantMessage += BigRegion.PermissionModule.CanInstantMessage;
1006 VirtualRegion.Permissions.OnInventoryTransfer += BigRegion.PermissionModule.CanInventoryTransfer; //NOT YET IMPLEMENTED 1006 VirtualRegion.Permissions.OnInventoryTransfer += BigRegion.PermissionModule.CanInventoryTransfer; //NOT YET IMPLEMENTED
1007 VirtualRegion.Permissions.OnIssueEstateCommand += BigRegion.PermissionModule.CanIssueEstateCommand; //FULLY IMPLEMENTED 1007 VirtualRegion.Permissions.OnIssueEstateCommand += BigRegion.PermissionModule.CanIssueEstateCommand; //FULLY IMPLEMENTED
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs
index 393322d..7c662c9 100644
--- a/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs
+++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs
@@ -105,9 +105,9 @@ namespace OpenSim.Region.RegionCombinerModule
105 return m_rootScene.Permissions.CanEditObject(objectid, editorid); 105 return m_rootScene.Permissions.CanEditObject(objectid, editorid);
106 } 106 }
107 107
108 public bool CanEditParcel(UUID user, ILandObject parcel, Scene scene) 108 public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers g, Scene scene)
109 { 109 {
110 return m_rootScene.Permissions.CanEditParcel(user, parcel); 110 return m_rootScene.Permissions.CanEditParcelProperties(user, parcel, g);
111 } 111 }
112 112
113 public bool CanInstantMessage(UUID user, UUID target, Scene startscene) 113 public bool CanInstantMessage(UUID user, UUID target, Scene startscene)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 3c5f2d0..30fb252 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6287,16 +6287,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6287 { 6287 {
6288 m_host.AddScriptLPS(1); 6288 m_host.AddScriptLPS(1);
6289 UUID key; 6289 UUID key;
6290 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; 6290 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
6291 if (land.OwnerID == m_host.OwnerID) 6291 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed))
6292 { 6292 {
6293 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 6293 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
6294 if (UUID.TryParse(avatar, out key)) 6294 if (UUID.TryParse(avatar, out key))
6295 { 6295 {
6296 entry.AgentID = key; 6296 if (land.LandData.ParcelAccessList.FindIndex(
6297 entry.Flags = AccessList.Access; 6297 delegate(ParcelManager.ParcelAccessEntry e)
6298 entry.Time = DateTime.Now.AddHours(hours); 6298 {
6299 land.ParcelAccessList.Add(entry); 6299 if (e.AgentID == key && e.Flags == AccessList.Access)
6300 return true;
6301 return false;
6302 }) == -1)
6303 {
6304 entry.AgentID = key;
6305 entry.Flags = AccessList.Access;
6306 entry.Time = DateTime.Now.AddHours(hours);
6307 land.LandData.ParcelAccessList.Add(entry);
6308 }
6300 } 6309 }
6301 } 6310 }
6302 ScriptSleep(100); 6311 ScriptSleep(100);
@@ -9023,7 +9032,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9023 // according to the docs, this command only works if script owner and land owner are the same 9032 // according to the docs, this command only works if script owner and land owner are the same
9024 // lets add estate owners and gods, too, and use the generic permission check. 9033 // lets add estate owners and gods, too, and use the generic permission check.
9025 ILandObject landObject = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); 9034 ILandObject landObject = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
9026 if (!World.Permissions.CanEditParcel(m_host.OwnerID, landObject)) return; 9035 if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, landObject, GroupPowers.ChangeMedia)) return;
9027 9036
9028 bool update = false; // send a ParcelMediaUpdate (and possibly change the land's media URL)? 9037 bool update = false; // send a ParcelMediaUpdate (and possibly change the land's media URL)?
9029 byte loop = 0; 9038 byte loop = 0;
@@ -9466,16 +9475,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9466 { 9475 {
9467 m_host.AddScriptLPS(1); 9476 m_host.AddScriptLPS(1);
9468 UUID key; 9477 UUID key;
9469 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; 9478 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
9470 if (land.OwnerID == m_host.OwnerID) 9479 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned))
9471 { 9480 {
9472 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 9481 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
9473 if (UUID.TryParse(avatar, out key)) 9482 if (UUID.TryParse(avatar, out key))
9474 { 9483 {
9475 entry.AgentID = key; 9484 if (land.LandData.ParcelAccessList.FindIndex(
9476 entry.Flags = AccessList.Ban; 9485 delegate(ParcelManager.ParcelAccessEntry e)
9477 entry.Time = DateTime.Now.AddHours(hours); 9486 {
9478 land.ParcelAccessList.Add(entry); 9487 if (e.AgentID == key && e.Flags == AccessList.Ban)
9488 return true;
9489 return false;
9490 }) == -1)
9491 {
9492 entry.AgentID = key;
9493 entry.Flags = AccessList.Ban;
9494 entry.Time = DateTime.Now.AddHours(hours);
9495 land.LandData.ParcelAccessList.Add(entry);
9496 }
9479 } 9497 }
9480 } 9498 }
9481 ScriptSleep(100); 9499 ScriptSleep(100);
@@ -9485,19 +9503,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9485 { 9503 {
9486 m_host.AddScriptLPS(1); 9504 m_host.AddScriptLPS(1);
9487 UUID key; 9505 UUID key;
9488 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; 9506 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
9489 if (land.OwnerID == m_host.OwnerID) 9507 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed))
9490 { 9508 {
9491 if (UUID.TryParse(avatar, out key)) 9509 if (UUID.TryParse(avatar, out key))
9492 { 9510 {
9493 foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) 9511 int idx = land.LandData.ParcelAccessList.FindIndex(
9494 { 9512 delegate(ParcelManager.ParcelAccessEntry e)
9495 if (entry.AgentID == key && entry.Flags == AccessList.Access) 9513 {
9496 { 9514 if (e.AgentID == key && e.Flags == AccessList.Access)
9497 land.ParcelAccessList.Remove(entry); 9515 return true;
9498 break; 9516 return false;
9499 } 9517 });
9500 } 9518
9519 if (idx != -1)
9520 land.LandData.ParcelAccessList.RemoveAt(idx);
9501 } 9521 }
9502 } 9522 }
9503 ScriptSleep(100); 9523 ScriptSleep(100);
@@ -9507,19 +9527,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9507 { 9527 {
9508 m_host.AddScriptLPS(1); 9528 m_host.AddScriptLPS(1);
9509 UUID key; 9529 UUID key;
9510 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; 9530 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
9511 if (land.OwnerID == m_host.OwnerID) 9531 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned))
9512 { 9532 {
9513 if (UUID.TryParse(avatar, out key)) 9533 if (UUID.TryParse(avatar, out key))
9514 { 9534 {
9515 foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) 9535 int idx = land.LandData.ParcelAccessList.FindIndex(
9516 { 9536 delegate(ParcelManager.ParcelAccessEntry e)
9517 if (entry.AgentID == key && entry.Flags == AccessList.Ban) 9537 {
9518 { 9538 if (e.AgentID == key && e.Flags == AccessList.Ban)
9519 land.ParcelAccessList.Remove(entry); 9539 return true;
9520 break; 9540 return false;
9521 } 9541 });
9522 } 9542
9543 if (idx != -1)
9544 land.LandData.ParcelAccessList.RemoveAt(idx);
9523 } 9545 }
9524 } 9546 }
9525 ScriptSleep(100); 9547 ScriptSleep(100);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 827626f..5a796b8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -336,6 +336,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
336 } 336 }
337 } 337 }
338 338
339 internal void OSSLDeprecated(string function, string replacement)
340 {
341 OSSLShoutError(string.Format("Use of function {0} is deprecated. Use {1} instead.", function, replacement));
342 }
343
339 protected void ScriptSleep(int delay) 344 protected void ScriptSleep(int delay)
340 { 345 {
341 delay = (int)((float)delay * m_ScriptDelayFactor); 346 delay = (int)((float)delay * m_ScriptDelayFactor);
@@ -347,13 +352,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
347 // 352 //
348 // OpenSim functions 353 // OpenSim functions
349 // 354 //
355 public LSL_Integer osSetTerrainHeight(int x, int y, double val)
356 {
357 CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight");
358 return SetTerrainHeight(x, y, val);
359 }
350 public LSL_Integer osTerrainSetHeight(int x, int y, double val) 360 public LSL_Integer osTerrainSetHeight(int x, int y, double val)
351 { 361 {
352 CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight"); 362 CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight");
353 363 OSSLDeprecated("osTerrainSetHeight", "osSetTerrainHeight");
364 return SetTerrainHeight(x, y, val);
365 }
366 private LSL_Integer SetTerrainHeight(int x, int y, double val)
367 {
354 m_host.AddScriptLPS(1); 368 m_host.AddScriptLPS(1);
355 if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) 369 if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0)
356 OSSLError("osTerrainSetHeight: Coordinate out of bounds"); 370 OSSLError("osSetTerrainHeight: Coordinate out of bounds");
357 371
358 if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) 372 if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0)))
359 { 373 {
@@ -366,13 +380,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
366 } 380 }
367 } 381 }
368 382
383 public LSL_Float osGetTerrainHeight(int x, int y)
384 {
385 CheckThreatLevel(ThreatLevel.None, "osGetTerrainHeight");
386 return GetTerrainHeight(x, y);
387 }
369 public LSL_Float osTerrainGetHeight(int x, int y) 388 public LSL_Float osTerrainGetHeight(int x, int y)
370 { 389 {
371 CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight"); 390 CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight");
372 391 OSSLDeprecated("osTerrainGetHeight", "osGetTerrainHeight");
392 return GetTerrainHeight(x, y);
393 }
394 private LSL_Float GetTerrainHeight(int x, int y)
395 {
373 m_host.AddScriptLPS(1); 396 m_host.AddScriptLPS(1);
374 if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) 397 if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0)
375 OSSLError("osTerrainGetHeight: Coordinate out of bounds"); 398 OSSLError("osGetTerrainHeight: Coordinate out of bounds");
376 399
377 return World.Heightmap[x, y]; 400 return World.Heightmap[x, y];
378 } 401 }
@@ -1001,9 +1024,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1001 return drawList; 1024 return drawList;
1002 } 1025 }
1003 1026
1027 public string osSetPenColor(string drawList, string color)
1028 {
1029 CheckThreatLevel(ThreatLevel.None, "osSetPenColor");
1030
1031 m_host.AddScriptLPS(1);
1032 drawList += "PenColor " + color + "; ";
1033 return drawList;
1034 }
1035 // Deprecated
1004 public string osSetPenColour(string drawList, string colour) 1036 public string osSetPenColour(string drawList, string colour)
1005 { 1037 {
1006 CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); 1038 CheckThreatLevel(ThreatLevel.None, "osSetPenColour");
1039 OSSLDeprecated("osSetPenColour", "osSetPenColor");
1007 1040
1008 m_host.AddScriptLPS(1); 1041 m_host.AddScriptLPS(1);
1009 drawList += "PenColour " + colour + "; "; 1042 drawList += "PenColour " + colour + "; ";
@@ -1012,7 +1045,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1012 1045
1013 public string osSetPenCap(string drawList, string direction, string type) 1046 public string osSetPenCap(string drawList, string direction, string type)
1014 { 1047 {
1015 CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); 1048 CheckThreatLevel(ThreatLevel.None, "osSetPenCap");
1016 1049
1017 m_host.AddScriptLPS(1); 1050 m_host.AddScriptLPS(1);
1018 drawList += "PenCap " + direction + "," + type + "; "; 1051 drawList += "PenCap " + direction + "," + type + "; ";
@@ -1157,6 +1190,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1157 public double osSunGetParam(string param) 1190 public double osSunGetParam(string param)
1158 { 1191 {
1159 CheckThreatLevel(ThreatLevel.None, "osSunGetParam"); 1192 CheckThreatLevel(ThreatLevel.None, "osSunGetParam");
1193 OSSLDeprecated("osSunGetParam", "osGetSunParam");
1194 return GetSunParam(param);
1195 }
1196 public double osGetSunParam(string param)
1197 {
1198 CheckThreatLevel(ThreatLevel.None, "osGetSunParam");
1199 return GetSunParam(param);
1200 }
1201 private double GetSunParam(string param)
1202 {
1160 m_host.AddScriptLPS(1); 1203 m_host.AddScriptLPS(1);
1161 1204
1162 double value = 0.0; 1205 double value = 0.0;
@@ -1173,6 +1216,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1173 public void osSunSetParam(string param, double value) 1216 public void osSunSetParam(string param, double value)
1174 { 1217 {
1175 CheckThreatLevel(ThreatLevel.None, "osSunSetParam"); 1218 CheckThreatLevel(ThreatLevel.None, "osSunSetParam");
1219 OSSLDeprecated("osSunSetParam", "osSetSunParam");
1220 SetSunParam(param, value);
1221 }
1222 public void osSetSunParam(string param, double value)
1223 {
1224 CheckThreatLevel(ThreatLevel.None, "osSetSunParam");
1225 SetSunParam(param, value);
1226 }
1227 private void SetSunParam(string param, double value)
1228 {
1176 m_host.AddScriptLPS(1); 1229 m_host.AddScriptLPS(1);
1177 1230
1178 ISunModule module = World.RequestModuleInterface<ISunModule>(); 1231 ISunModule module = World.RequestModuleInterface<ISunModule>();
@@ -1198,9 +1251,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1198 return String.Empty; 1251 return String.Empty;
1199 } 1252 }
1200 1253
1201 public void osWindParamSet(string plugin, string param, float value) 1254 public void osSetWindParam(string plugin, string param, float value)
1202 { 1255 {
1203 CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamSet"); 1256 CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam");
1204 m_host.AddScriptLPS(1); 1257 m_host.AddScriptLPS(1);
1205 1258
1206 IWindModule module = World.RequestModuleInterface<IWindModule>(); 1259 IWindModule module = World.RequestModuleInterface<IWindModule>();
@@ -1214,9 +1267,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1214 } 1267 }
1215 } 1268 }
1216 1269
1217 public float osWindParamGet(string plugin, string param) 1270 public float osGetWindParam(string plugin, string param)
1218 { 1271 {
1219 CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamGet"); 1272 CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam");
1220 m_host.AddScriptLPS(1); 1273 m_host.AddScriptLPS(1);
1221 1274
1222 IWindModule module = World.RequestModuleInterface<IWindModule>(); 1275 IWindModule module = World.RequestModuleInterface<IWindModule>();
@@ -1257,7 +1310,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1257 1310
1258 public void osParcelSetDetails(LSL_Vector pos, LSL_List rules) 1311 public void osParcelSetDetails(LSL_Vector pos, LSL_List rules)
1259 { 1312 {
1260 CheckThreatLevel(ThreatLevel.High, "osParcelSetDetails"); 1313 const string functionName = "osParcelSetDetails";
1314 CheckThreatLevel(ThreatLevel.High, functionName);
1315 OSSLDeprecated(functionName, "osSetParcelDetails");
1316 SetParcelDetails(pos, rules, functionName);
1317 }
1318 public void osSetParcelDetails(LSL_Vector pos, LSL_List rules)
1319 {
1320 const string functionName = "osSetParcelDetails";
1321 CheckThreatLevel(ThreatLevel.High, functionName);
1322 SetParcelDetails(pos, rules, functionName);
1323 }
1324 private void SetParcelDetails(LSL_Vector pos, LSL_List rules, string functionName)
1325 {
1261 m_host.AddScriptLPS(1); 1326 m_host.AddScriptLPS(1);
1262 1327
1263 // Get a reference to the land data and make sure the owner of the script 1328 // Get a reference to the land data and make sure the owner of the script
@@ -1270,7 +1335,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1270 return; 1335 return;
1271 } 1336 }
1272 1337
1273 if (! World.Permissions.CanEditParcel(m_host.OwnerID, startLandObject)) 1338 if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, startLandObject, GroupPowers.LandOptions))
1274 { 1339 {
1275 OSSLShoutError("You do not have permission to modify the parcel"); 1340 OSSLShoutError("You do not have permission to modify the parcel");
1276 return; 1341 return;
@@ -1296,13 +1361,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1296 break; 1361 break;
1297 1362
1298 case 2: 1363 case 2:
1299 CheckThreatLevel(ThreatLevel.VeryHigh, "osParcelSetDetails"); 1364 CheckThreatLevel(ThreatLevel.VeryHigh, functionName);
1300 if (UUID.TryParse(arg , out uuid)) 1365 if (UUID.TryParse(arg , out uuid))
1301 newLand.OwnerID = uuid; 1366 newLand.OwnerID = uuid;
1302 break; 1367 break;
1303 1368
1304 case 3: 1369 case 3:
1305 CheckThreatLevel(ThreatLevel.VeryHigh, "osParcelSetDetails"); 1370 CheckThreatLevel(ThreatLevel.VeryHigh, functionName);
1306 if (UUID.TryParse(arg , out uuid)) 1371 if (UUID.TryParse(arg , out uuid))
1307 newLand.GroupID = uuid; 1372 newLand.GroupID = uuid;
1308 break; 1373 break;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 10d61ca..63007c6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -67,8 +67,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
67 string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, 67 string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams,
68 bool blend, int disp, int timer, int alpha, int face); 68 bool blend, int disp, int timer, int alpha, int face);
69 69
70 LSL_Float osTerrainGetHeight(int x, int y); 70 LSL_Float osGetTerrainHeight(int x, int y);
71 LSL_Integer osTerrainSetHeight(int x, int y, double val); 71 LSL_Float osTerrainGetHeight(int x, int y); // Deprecated
72 LSL_Integer osSetTerrainHeight(int x, int y, double val);
73 LSL_Integer osTerrainSetHeight(int x, int y, double val); //Deprecated
72 void osTerrainFlush(); 74 void osTerrainFlush();
73 75
74 int osRegionRestart(double seconds); 76 int osRegionRestart(double seconds);
@@ -107,7 +109,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
107 string osSetFontName(string drawList, string fontName); 109 string osSetFontName(string drawList, string fontName);
108 string osSetFontSize(string drawList, int fontSize); 110 string osSetFontSize(string drawList, int fontSize);
109 string osSetPenSize(string drawList, int penSize); 111 string osSetPenSize(string drawList, int penSize);
110 string osSetPenColour(string drawList, string colour); 112 string osSetPenColor(string drawList, string color);
113 string osSetPenColour(string drawList, string colour); // Deprecated
111 string osSetPenCap(string drawList, string direction, string type); 114 string osSetPenCap(string drawList, string direction, string type);
112 string osDrawImage(string drawList, int width, int height, string imageUrl); 115 string osDrawImage(string drawList, int width, int height, string imageUrl);
113 vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize); 116 vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize);
@@ -119,18 +122,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
119 void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour); 122 void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour);
120 void osSetEstateSunSettings(bool sunFixed, double sunHour); 123 void osSetEstateSunSettings(bool sunFixed, double sunHour);
121 double osGetCurrentSunHour(); 124 double osGetCurrentSunHour();
122 double osSunGetParam(string param); 125 double osGetSunParam(string param);
123 void osSunSetParam(string param, double value); 126 double osSunGetParam(string param); // Deprecated
127 void osSetSunParam(string param, double value);
128 void osSunSetParam(string param, double value); // Deprecated
124 129
125 // Wind Module Functions 130 // Wind Module Functions
126 string osWindActiveModelPluginName(); 131 string osWindActiveModelPluginName();
127 void osWindParamSet(string plugin, string param, float value); 132 void osSetWindParam(string plugin, string param, float value);
128 float osWindParamGet(string plugin, string param); 133 float osGetWindParam(string plugin, string param);
129 134
130 // Parcel commands 135 // Parcel commands
131 void osParcelJoin(vector pos1, vector pos2); 136 void osParcelJoin(vector pos1, vector pos2);
132 void osParcelSubdivide(vector pos1, vector pos2); 137 void osParcelSubdivide(vector pos1, vector pos2);
133 void osParcelSetDetails(vector pos, LSL_List rules); 138 void osSetParcelDetails(vector pos, LSL_List rules);
139 void osParcelSetDetails(vector pos, LSL_List rules); // Deprecated
134 140
135 string osGetScriptEngineName(); 141 string osGetScriptEngineName();
136 string osGetSimulatorVersion(); 142 string osGetSimulatorVersion();
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index f3142e6..e3ea556 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -81,11 +81,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
81 return m_OSSL_Functions.osGetCurrentSunHour(); 81 return m_OSSL_Functions.osGetCurrentSunHour();
82 } 82 }
83 83
84 public double osGetSunParam(string param)
85 {
86 return m_OSSL_Functions.osGetSunParam(param);
87 }
88 // Deprecated
84 public double osSunGetParam(string param) 89 public double osSunGetParam(string param)
85 { 90 {
86 return m_OSSL_Functions.osSunGetParam(param); 91 return m_OSSL_Functions.osSunGetParam(param);
87 } 92 }
88 93
94 public void osSetSunParam(string param, double value)
95 {
96 m_OSSL_Functions.osSetSunParam(param, value);
97 }
98 // Deprecated
89 public void osSunSetParam(string param, double value) 99 public void osSunSetParam(string param, double value)
90 { 100 {
91 m_OSSL_Functions.osSunSetParam(param, value); 101 m_OSSL_Functions.osSunSetParam(param, value);
@@ -97,14 +107,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
97 } 107 }
98 108
99// Not yet plugged in as available OSSL functions, so commented out 109// Not yet plugged in as available OSSL functions, so commented out
100// void osWindParamSet(string plugin, string param, float value) 110// void osSetWindParam(string plugin, string param, float value)
101// { 111// {
102// m_OSSL_Functions.osWindParamSet(plugin, param, value); 112// m_OSSL_Functions.osSetWindParam(plugin, param, value);
103// } 113// }
104// 114//
105// float osWindParamGet(string plugin, string param) 115// float osGetWindParam(string plugin, string param)
106// { 116// {
107// return m_OSSL_Functions.osWindParamGet(plugin, param); 117// return m_OSSL_Functions.osGetWindParam(plugin, param);
108// } 118// }
109 119
110 public void osParcelJoin(vector pos1, vector pos2) 120 public void osParcelJoin(vector pos1, vector pos2)
@@ -116,7 +126,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
116 { 126 {
117 m_OSSL_Functions.osParcelSubdivide(pos1, pos2); 127 m_OSSL_Functions.osParcelSubdivide(pos1, pos2);
118 } 128 }
119 129
130 public void osSetParcelDetails(vector pos, LSL_List rules)
131 {
132 m_OSSL_Functions.osSetParcelDetails(pos, rules);
133 }
134 // Deprecated
120 public void osParcelSetDetails(vector pos, LSL_List rules) 135 public void osParcelSetDetails(vector pos, LSL_List rules)
121 { 136 {
122 m_OSSL_Functions.osParcelSetDetails(pos,rules); 137 m_OSSL_Functions.osParcelSetDetails(pos,rules);
@@ -165,11 +180,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
165 blend, disp, timer, alpha, face); 180 blend, disp, timer, alpha, face);
166 } 181 }
167 182
183 public LSL_Float osGetTerrainHeight(int x, int y)
184 {
185 return m_OSSL_Functions.osGetTerrainHeight(x, y);
186 }
187 // Deprecated
168 public LSL_Float osTerrainGetHeight(int x, int y) 188 public LSL_Float osTerrainGetHeight(int x, int y)
169 { 189 {
170 return m_OSSL_Functions.osTerrainGetHeight(x, y); 190 return m_OSSL_Functions.osTerrainGetHeight(x, y);
171 } 191 }
172 192
193 public LSL_Integer osSetTerrainHeight(int x, int y, double val)
194 {
195 return m_OSSL_Functions.osSetTerrainHeight(x, y, val);
196 }
197 // Deprecated
173 public LSL_Integer osTerrainSetHeight(int x, int y, double val) 198 public LSL_Integer osTerrainSetHeight(int x, int y, double val)
174 { 199 {
175 return m_OSSL_Functions.osTerrainSetHeight(x, y, val); 200 return m_OSSL_Functions.osTerrainSetHeight(x, y, val);
@@ -333,6 +358,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
333 return m_OSSL_Functions.osSetPenCap(drawList, direction, type); 358 return m_OSSL_Functions.osSetPenCap(drawList, direction, type);
334 } 359 }
335 360
361 public string osSetPenColor(string drawList, string color)
362 {
363 return m_OSSL_Functions.osSetPenColor(drawList, color);
364 }
365 // Deprecated
336 public string osSetPenColour(string drawList, string colour) 366 public string osSetPenColour(string drawList, string colour)
337 { 367 {
338 return m_OSSL_Functions.osSetPenColour(drawList, colour); 368 return m_OSSL_Functions.osSetPenColour(drawList, colour);
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 85c1380..a1d9167 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -29,6 +29,7 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Drawing; 31using System.Drawing;
32using System.IO;
32using System.Net; 33using System.Net;
33using System.Reflection; 34using System.Reflection;
34using OpenSim.Framework; 35using OpenSim.Framework;
@@ -48,7 +49,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
48 { 49 {
49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50 51
51// private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013"); 52 private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013");
52 53
53 private IAssetService m_AssetService; 54 private IAssetService m_AssetService;
54 55
@@ -143,43 +144,44 @@ namespace OpenSim.Services.Connectors.Hypergrid
143 return true; 144 return true;
144 } 145 }
145 146
146 UUID m_MissingTexture = new UUID("5748decc-f629-461c-9a36-a35a221fe21f"); 147 public UUID GetMapImage(UUID regionID, string imageURL, string storagePath)
147
148 public UUID GetMapImage(UUID regionID, string imageURL)
149 { 148 {
150 if (m_AssetService == null) 149 if (m_AssetService == null)
151 return m_MissingTexture; 150 {
151 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: No AssetService defined. Map tile not retrieved.");
152 return m_HGMapImage;
153 }
152 154
155 UUID mapTile = m_HGMapImage;
156 string filename = string.Empty;
157 Bitmap bitmap = null;
153 try 158 try
154 { 159 {
155
156 WebClient c = new WebClient(); 160 WebClient c = new WebClient();
157 //m_log.Debug("JPEG: " + imageURL); 161 //m_log.Debug("JPEG: " + imageURL);
158 string filename = regionID.ToString(); 162 string name = regionID.ToString();
159 c.DownloadFile(imageURL, filename + ".jpg"); 163 filename = Path.Combine(storagePath, name + ".jpg");
160 Bitmap m = new Bitmap(filename + ".jpg"); 164 c.DownloadFile(imageURL, filename);
165 bitmap = new Bitmap(filename);
161 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); 166 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
162 byte[] imageData = OpenJPEG.EncodeFromImage(m, true); 167 byte[] imageData = OpenJPEG.EncodeFromImage(bitmap, true);
163 AssetBase ass = new AssetBase(UUID.Random(), "region " + filename, (sbyte)AssetType.Texture, regionID.ToString()); 168 AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString());
164 169
165 // !!! for now 170 // !!! for now
166 //info.RegionSettings.TerrainImageID = ass.FullID; 171 //info.RegionSettings.TerrainImageID = ass.FullID;
167 172
168 ass.Temporary = true;
169 ass.Local = true;
170 ass.Data = imageData; 173 ass.Data = imageData;
171 174
172 m_AssetService.Store(ass); 175 m_AssetService.Store(ass);
173 176
174 // finally 177 // finally
175 return ass.FullID; 178 mapTile = ass.FullID;
176
177 } 179 }
178 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke 180 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke
179 { 181 {
180 m_log.Warn("[GATEKEEPER SERVICE CONNECTOR]: Failed getting/storing map image, because it is probably already in the cache"); 182 m_log.Info("[GATEKEEPER SERVICE CONNECTOR]: Failed getting/storing map image, because it is probably already in the cache");
181 } 183 }
182 return UUID.Zero; 184 return mapTile;
183 } 185 }
184 186
185 public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID) 187 public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID)
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 0c41935..7ddcfa6 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -104,7 +104,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
104 return false; 104 return false;
105 } 105 }
106 106
107 string uri = m_ServerURL + "/homeagent/" + aCircuit.AgentID + "/"; 107 string uri = m_ServerURL + "homeagent/" + aCircuit.AgentID + "/";
108 108
109 Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri); 109 Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri);
110 110
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index e2032d9..4e3cfa5 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -235,6 +235,7 @@ namespace OpenSim.Services.Connectors.Simulation
235 m_log.Warn("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message); 235 m_log.Warn("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message);
236 return null; 236 return null;
237 } 237 }
238
238 // Add the input arguments 239 // Add the input arguments
239 args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); 240 args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
240 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); 241 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index d5d0195..643d0fc 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -26,7 +26,9 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections;
29using System.Collections.Generic; 30using System.Collections.Generic;
31using System.IO;
30using System.Linq; 32using System.Linq;
31using System.Net; 33using System.Net;
32using System.Reflection; 34using System.Reflection;
@@ -51,8 +53,6 @@ namespace OpenSim.Services.GridService
51 LogManager.GetLogger( 53 LogManager.GetLogger(
52 MethodBase.GetCurrentMethod().DeclaringType); 54 MethodBase.GetCurrentMethod().DeclaringType);
53 55
54 private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013");
55
56 private static uint m_autoMappingX = 0; 56 private static uint m_autoMappingX = 0;
57 private static uint m_autoMappingY = 0; 57 private static uint m_autoMappingY = 0;
58 private static bool m_enableAutoMapping = false; 58 private static bool m_enableAutoMapping = false;
@@ -64,6 +64,7 @@ namespace OpenSim.Services.GridService
64 64
65 protected UUID m_ScopeID = UUID.Zero; 65 protected UUID m_ScopeID = UUID.Zero;
66 protected bool m_Check4096 = true; 66 protected bool m_Check4096 = true;
67 protected string m_MapTileDirectory = string.Empty;
67 68
68 // Hyperlink regions are hyperlinks on the map 69 // Hyperlink regions are hyperlinks on the map
69 public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>(); 70 public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
@@ -120,9 +121,24 @@ namespace OpenSim.Services.GridService
120 121
121 m_Check4096 = gridConfig.GetBoolean("Check4096", true); 122 m_Check4096 = gridConfig.GetBoolean("Check4096", true);
122 123
124 m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", string.Empty);
125
123 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); 126 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
124 127
125 m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services..."); 128 m_log.Debug("[HYPERGRID LINKER]: Loaded all services...");
129 }
130
131 if (!string.IsNullOrEmpty(m_MapTileDirectory))
132 {
133 try
134 {
135 Directory.CreateDirectory(m_MapTileDirectory);
136 }
137 catch (Exception e)
138 {
139 m_log.WarnFormat("[HYPERGRID LINKER]: Could not create map tile storage directory {0}: {1}", m_MapTileDirectory, e);
140 m_MapTileDirectory = string.Empty;
141 }
126 } 142 }
127 143
128 if (MainConsole.Instance != null) 144 if (MainConsole.Instance != null)
@@ -215,7 +231,9 @@ namespace OpenSim.Services.GridService
215 231
216 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason) 232 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason)
217 { 233 {
218 m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, remoteRegionName, xloc, yloc); 234 m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}, in {2}-{3}",
235 ((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI),
236 remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize);
219 237
220 reason = string.Empty; 238 reason = string.Empty;
221 regInfo = new GridRegion(); 239 regInfo = new GridRegion();
@@ -242,7 +260,9 @@ namespace OpenSim.Services.GridService
242 GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY); 260 GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY);
243 if (region != null) 261 if (region != null)
244 { 262 {
245 m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}", regInfo.RegionLocX, regInfo.RegionLocY, region.RegionName, region.RegionID); 263 m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}",
264 regInfo.RegionLocX / Constants.RegionSize, regInfo.RegionLocY / Constants.RegionSize,
265 region.RegionName, region.RegionID);
246 reason = "Coordinates are already in use"; 266 reason = "Coordinates are already in use";
247 return false; 267 return false;
248 } 268 }
@@ -266,41 +286,22 @@ namespace OpenSim.Services.GridService
266 if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason)) 286 if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason))
267 return false; 287 return false;
268 288
269 if (regionID != UUID.Zero) 289 if (regionID == UUID.Zero)
270 {
271 region = m_GridService.GetRegionByUUID(scopeID, regionID);
272 if (region != null)
273 {
274 m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize);
275 regInfo = region;
276 return true;
277 }
278
279 regInfo.RegionID = regionID;
280
281 if ( externalName == string.Empty )
282 regInfo.RegionName = regInfo.ServerURI;
283 else
284 regInfo.RegionName = externalName;
285
286 m_log.Debug("[HYPERGRID LINKER]: naming linked region " + regInfo.RegionName);
287
288 // Try get the map image
289 //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL);
290 // I need a texture that works for this... the one I tried doesn't seem to be working
291 regInfo.TerrainImage = m_HGMapImage;
292
293 AddHyperlinkRegion(regInfo, handle);
294 m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID);
295
296 }
297 else
298 { 290 {
299 m_log.Warn("[HYPERGRID LINKER]: Unable to link region"); 291 m_log.Warn("[HYPERGRID LINKER]: Unable to link region");
300 reason = "Remote region could not be found"; 292 reason = "Remote region could not be found";
301 return false; 293 return false;
302 } 294 }
303 295
296 region = m_GridService.GetRegionByUUID(scopeID, regionID);
297 if (region != null)
298 {
299 m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}",
300 region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize);
301 regInfo = region;
302 return true;
303 }
304
304 uint x, y; 305 uint x, y;
305 if (m_Check4096 && !Check4096(handle, out x, out y)) 306 if (m_Check4096 && !Check4096(handle, out x, out y))
306 { 307 {
@@ -310,7 +311,20 @@ namespace OpenSim.Services.GridService
310 return false; 311 return false;
311 } 312 }
312 313
313 m_log.Debug("[HYPERGRID LINKER]: link region succeeded"); 314 regInfo.RegionID = regionID;
315
316 if ( externalName == string.Empty )
317 regInfo.RegionName = regInfo.ServerURI;
318 else
319 regInfo.RegionName = externalName;
320
321 m_log.Debug("[HYPERGRID LINKER]: naming linked region " + regInfo.RegionName);
322
323 // Get the map image
324 regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL, m_MapTileDirectory);
325
326 AddHyperlinkRegion(regInfo, handle);
327 m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID);
314 return true; 328 return true;
315 } 329 }
316 330
@@ -423,15 +437,14 @@ namespace OpenSim.Services.GridService
423 return; 437 return;
424 } 438 }
425 439
426 MainConsole.Instance.Output("Region Name Region UUID"); 440 MainConsole.Instance.Output("Region Name");
427 MainConsole.Instance.Output("Location URI"); 441 MainConsole.Instance.Output("Location Region UUID");
428 MainConsole.Instance.Output("-------------------------------------------------------------------------------"); 442 MainConsole.Instance.Output(new string('-', 72));
429 foreach (RegionData r in regions) 443 foreach (RegionData r in regions)
430 { 444 {
431 MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n", 445 MainConsole.Instance.Output(String.Format("{0}\n{2,-32} {1}\n",
432 r.RegionName, r.RegionID, 446 r.RegionName, r.RegionID, String.Format("{0},{1} ({2},{3})", r.posX, r.posY,
433 String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256), 447 r.posX / Constants.RegionSize, r.posY / Constants.RegionSize)));
434 "http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverHttpPort"].ToString()));
435 } 448 }
436 return; 449 return;
437 } 450 }
@@ -459,11 +472,14 @@ namespace OpenSim.Services.GridService
459 xloc = Convert.ToInt32(cmdparams[0]) * (int)Constants.RegionSize; 472 xloc = Convert.ToInt32(cmdparams[0]) * (int)Constants.RegionSize;
460 yloc = Convert.ToInt32(cmdparams[1]) * (int)Constants.RegionSize; 473 yloc = Convert.ToInt32(cmdparams[1]) * (int)Constants.RegionSize;
461 serverURI = cmdparams[2]; 474 serverURI = cmdparams[2];
462 if (cmdparams.Length == 4) 475 if (cmdparams.Length > 3)
463 remoteName = cmdparams[3]; 476 remoteName = string.Join(" ", cmdparams, 3, cmdparams.Length - 3);
464 string reason = string.Empty; 477 string reason = string.Empty;
465 GridRegion regInfo; 478 GridRegion regInfo;
466 TryCreateLink(UUID.Zero, xloc, yloc, remoteName, 0, null, serverURI, UUID.Zero, out regInfo, out reason); 479 if (TryCreateLink(UUID.Zero, xloc, yloc, remoteName, 0, null, serverURI, UUID.Zero, out regInfo, out reason))
480 MainConsole.Instance.Output("Hyperlink established");
481 else
482 MainConsole.Instance.Output("Failed to link region: " + reason);
467 } 483 }
468 484
469 private void RunHGCommand(string command, string[] cmdparams) 485 private void RunHGCommand(string command, string[] cmdparams)
@@ -488,18 +504,6 @@ namespace OpenSim.Services.GridService
488 } 504 }
489 else if (command.Equals("link-region")) 505 else if (command.Equals("link-region"))
490 { 506 {
491 if (cmdparams.Length > 0 && cmdparams.Length < 5)
492 {
493 RunLinkRegionCommand(cmdparams);
494 }
495 else
496 {
497 LinkRegionCmdUsage();
498 }
499 return;
500 }
501 else if (command.Equals("link-region"))
502 {
503 if (cmdparams.Length < 3) 507 if (cmdparams.Length < 3)
504 { 508 {
505 if ((cmdparams.Length == 1) || (cmdparams.Length == 2)) 509 if ((cmdparams.Length == 1) || (cmdparams.Length == 2))
@@ -514,40 +518,24 @@ namespace OpenSim.Services.GridService
514 } 518 }
515 519
516 //this should be the prefererred way of setting up hg links now 520 //this should be the prefererred way of setting up hg links now
517 if ( cmdparams[2].StartsWith("http") && ( cmdparams.Length >= 3 && cmdparams.Length <= 5 )) { 521 if (cmdparams[2].StartsWith("http"))
522 {
518 RunLinkRegionCommand(cmdparams); 523 RunLinkRegionCommand(cmdparams);
519 } 524 }
520 else if (cmdparams[2].Contains(":")) 525 else if (cmdparams[2].Contains(":"))
521 { 526 {
522 // New format 527 // New format
523 int xloc, yloc; 528 string[] parts = cmdparams[2].Split(':');
524 string mapName; 529 if (parts.Length > 2)
525 try
526 { 530 {
527 xloc = Convert.ToInt32(cmdparams[0]); 531 // Insert remote region name
528 yloc = Convert.ToInt32(cmdparams[1]); 532 ArrayList parameters = new ArrayList(cmdparams);
529 mapName = cmdparams[2]; 533 parameters.Insert(3, parts[2]);
530 if (cmdparams.Length > 3) 534 cmdparams = (string[])parameters.ToArray(typeof(string));
531 for (int i = 3; i < cmdparams.Length; i++)
532 mapName += " " + cmdparams[i];
533
534 //m_log.Info(">> MapName: " + mapName);
535 }
536 catch (Exception e)
537 {
538 MainConsole.Instance.Output("[HGrid] Wrong format for link-region command: " + e.Message);
539 LinkRegionCmdUsage();
540 return;
541 } 535 }
536 cmdparams[2] = "http://" + parts[0] + ':' + parts[1];
542 537
543 // Convert cell coordinates given by the user to meters 538 RunLinkRegionCommand(cmdparams);
544 xloc = xloc * (int)Constants.RegionSize;
545 yloc = yloc * (int)Constants.RegionSize;
546 string reason = string.Empty;
547 if (TryLinkRegionToCoords(UUID.Zero, mapName, xloc, yloc, out reason) == null)
548 MainConsole.Instance.Output("Failed to link region: " + reason);
549 else
550 MainConsole.Instance.Output("Hyperlink established");
551 } 539 }
552 else 540 else
553 { 541 {
@@ -556,16 +544,12 @@ namespace OpenSim.Services.GridService
556 int xloc, yloc; 544 int xloc, yloc;
557 uint externalPort; 545 uint externalPort;
558 string externalHostName; 546 string externalHostName;
559 string serverURI;
560 try 547 try
561 { 548 {
562 xloc = Convert.ToInt32(cmdparams[0]); 549 xloc = Convert.ToInt32(cmdparams[0]);
563 yloc = Convert.ToInt32(cmdparams[1]); 550 yloc = Convert.ToInt32(cmdparams[1]);
564 externalPort = Convert.ToUInt32(cmdparams[3]); 551 externalPort = Convert.ToUInt32(cmdparams[3]);
565 externalHostName = cmdparams[2]; 552 externalHostName = cmdparams[2];
566 if ( cmdparams.Length == 4 ) {
567
568 }
569 //internalPort = Convert.ToUInt32(cmdparams[4]); 553 //internalPort = Convert.ToUInt32(cmdparams[4]);
570 //remotingPort = Convert.ToUInt32(cmdparams[5]); 554 //remotingPort = Convert.ToUInt32(cmdparams[5]);
571 } 555 }
@@ -582,27 +566,30 @@ namespace OpenSim.Services.GridService
582 string reason = string.Empty; 566 string reason = string.Empty;
583 if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) 567 if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason))
584 { 568 {
585 if (cmdparams.Length >= 5) 569 // What is this? The GridRegion instance will be discarded anyway,
586 { 570 // which effectively ignores any local name given with the command.
587 regInfo.RegionName = ""; 571 //if (cmdparams.Length >= 5)
588 for (int i = 4; i < cmdparams.Length; i++) 572 //{
589 regInfo.RegionName += cmdparams[i] + " "; 573 // regInfo.RegionName = "";
590 } 574 // for (int i = 4; i < cmdparams.Length; i++)
575 // regInfo.RegionName += cmdparams[i] + " ";
576 //}
591 } 577 }
592 } 578 }
593 return; 579 return;
594 } 580 }
595 else if (command.Equals("unlink-region")) 581 else if (command.Equals("unlink-region"))
596 { 582 {
597 if (cmdparams.Length < 1 || cmdparams.Length > 1) 583 if (cmdparams.Length < 1)
598 { 584 {
599 UnlinkRegionCmdUsage(); 585 UnlinkRegionCmdUsage();
600 return; 586 return;
601 } 587 }
602 if (TryUnlinkRegion(cmdparams[0])) 588 string region = string.Join(" ", cmdparams);
603 MainConsole.Instance.Output("Successfully unlinked " + cmdparams[0]); 589 if (TryUnlinkRegion(region))
590 MainConsole.Instance.Output("Successfully unlinked " + region);
604 else 591 else
605 MainConsole.Instance.Output("Unable to unlink " + cmdparams[0] + ", region not found."); 592 MainConsole.Instance.Output("Unable to unlink " + region + ", region not found.");
606 } 593 }
607 } 594 }
608 595
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 05be7b8..4419201 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -123,42 +123,39 @@ namespace OpenSim.Services.HypergridService
123 externalName = m_ExternalName + ((regionName != string.Empty) ? " " + regionName : ""); 123 externalName = m_ExternalName + ((regionName != string.Empty) ? " " + regionName : "");
124 imageURL = string.Empty; 124 imageURL = string.Empty;
125 reason = string.Empty; 125 reason = string.Empty;
126 126 GridRegion region = null;
127 127
128 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to link to {0}", (regionName == string.Empty)? "default region" : regionName); 128 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to link to {0}", (regionName == string.Empty)? "default region" : regionName);
129 if (!m_AllowTeleportsToAnyRegion || regionName == string.Empty) 129 if (!m_AllowTeleportsToAnyRegion || regionName == string.Empty)
130 { 130 {
131 List<GridRegion> defs = m_GridService.GetDefaultRegions(m_ScopeID); 131 List<GridRegion> defs = m_GridService.GetDefaultRegions(m_ScopeID);
132 if (defs != null && defs.Count > 0) 132 if (defs != null && defs.Count > 0)
133 m_DefaultGatewayRegion = defs[0];
134
135 try
136 { 133 {
137 regionID = m_DefaultGatewayRegion.RegionID; 134 region = defs[0];
138 regionHandle = m_DefaultGatewayRegion.RegionHandle; 135 m_DefaultGatewayRegion = region;
139 } 136 }
140 catch 137 else
141 { 138 {
142 reason = "Grid setup problem. Try specifying a particular region here."; 139 reason = "Grid setup problem. Try specifying a particular region here.";
143 m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to send information. Please specify a default region for this grid!"); 140 m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to send information. Please specify a default region for this grid!");
144 return false; 141 return false;
145 } 142 }
146
147 return true;
148 } 143 }
149 144 else
150 GridRegion region = m_GridService.GetRegionByName(m_ScopeID, regionName);
151 if (region == null)
152 { 145 {
153 reason = "Region not found"; 146 region = m_GridService.GetRegionByName(m_ScopeID, regionName);
154 return false; 147 if (region == null)
148 {
149 reason = "Region not found";
150 return false;
151 }
155 } 152 }
156 153
157 regionID = region.RegionID; 154 regionID = region.RegionID;
158 regionHandle = region.RegionHandle; 155 regionHandle = region.RegionHandle;
159 string regionimage = "regionImage" + region.RegionID.ToString();
160 regionimage = regionimage.Replace("-", "");
161 156
157 string regionimage = "regionImage" + regionID.ToString();
158 regionimage = regionimage.Replace("-", "");
162 imageURL = region.ServerURI + "index.php?method=" + regionimage; 159 imageURL = region.ServerURI + "index.php?method=" + regionimage;
163 160
164 return true; 161 return true;
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index 3519250..12dda48 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -101,7 +101,7 @@ namespace OpenSim.Services.HypergridService
101 serverConfig = config.Configs["GatekeeperService"]; 101 serverConfig = config.Configs["GatekeeperService"];
102 m_GridName = serverConfig.GetString("ExternalName", string.Empty); 102 m_GridName = serverConfig.GetString("ExternalName", string.Empty);
103 } 103 }
104 else if (!m_GridName.EndsWith("/")) 104 if (!m_GridName.EndsWith("/"))
105 m_GridName = m_GridName + "/"; 105 m_GridName = m_GridName + "/";
106 } 106 }
107 } 107 }
diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs
index c580078..9c992e0 100644
--- a/OpenSim/Services/Interfaces/IUserAccountService.cs
+++ b/OpenSim/Services/Interfaces/IUserAccountService.cs
@@ -101,7 +101,7 @@ namespace OpenSim.Services.Interfaces
101 if (str != string.Empty) 101 if (str != string.Empty)
102 { 102 {
103 string[] parts = str.Split(new char[] { ';' }); 103 string[] parts = str.Split(new char[] { ';' });
104 Dictionary<string, object> dic = new Dictionary<string, object>(); 104// Dictionary<string, object> dic = new Dictionary<string, object>();
105 foreach (string s in parts) 105 foreach (string s in parts)
106 { 106 {
107 string[] parts2 = s.Split(new char[] { '*' }); 107 string[] parts2 = s.Split(new char[] { '*' });
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 25d80bd..281b6e3 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -772,6 +772,8 @@ namespace OpenSim.Services.LLLoginService
772 { 772 {
773 aCircuit.ServiceURLs[kvp.Key] = kvp.Value; 773 aCircuit.ServiceURLs[kvp.Key] = kvp.Value;
774 } 774 }
775 if (!aCircuit.ServiceURLs[kvp.Key].ToString().EndsWith("/"))
776 aCircuit.ServiceURLs[kvp.Key] = aCircuit.ServiceURLs[kvp.Key] + "/";
775 } 777 }
776 778
777 // New style: service keys start with SRV_; override the previous 779 // New style: service keys start with SRV_; override the previous
@@ -784,6 +786,9 @@ namespace OpenSim.Services.LLLoginService
784 { 786 {
785 string keyName = serviceKey.Replace("SRV_", ""); 787 string keyName = serviceKey.Replace("SRV_", "");
786 aCircuit.ServiceURLs[keyName] = m_LoginServerConfig.GetString(serviceKey, string.Empty); 788 aCircuit.ServiceURLs[keyName] = m_LoginServerConfig.GetString(serviceKey, string.Empty);
789 if (!aCircuit.ServiceURLs[keyName].ToString().EndsWith("/"))
790 aCircuit.ServiceURLs[keyName] = aCircuit.ServiceURLs[keyName] + "/";
791
787 m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); 792 m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]);
788 } 793 }
789 } 794 }
diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs
new file mode 100644
index 0000000..6fb9df1
--- /dev/null
+++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs
@@ -0,0 +1,237 @@
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.Reflection;
31using log4net;
32using Mono.Addins;
33using Nini.Config;
34using OpenMetaverse;
35using OpenSim.Framework;
36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes;
38using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups;
39
40namespace OpenSim.Tests.Common.Mock
41{
42 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
43 public class MockGroupsServicesConnector : ISharedRegionModule, IGroupsServicesConnector
44 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46
47 public string Name
48 {
49 get { return "MockGroupsServicesConnector"; }
50 }
51
52 public Type ReplaceableInterface
53 {
54 get { return null; }
55 }
56
57 public void Initialise(IConfigSource config)
58 {
59 }
60
61 public void Close()
62 {
63 }
64
65 public void AddRegion(Scene scene)
66 {
67 m_log.DebugFormat("[MOCK GROUPS SERVICES CONNECTOR]: Adding to region {0}", scene.RegionInfo.RegionName);
68 scene.RegisterModuleInterface<IGroupsServicesConnector>(this);
69 }
70
71 public void RemoveRegion(Scene scene)
72 {
73 }
74
75 public void RegionLoaded(Scene scene)
76 {
77 }
78
79 public void PostInitialise()
80 {
81 }
82
83 public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID,
84 int membershipFee, bool openEnrollment, bool allowPublish,
85 bool maturePublish, UUID founderID)
86 {
87 return UUID.Zero;
88 }
89
90 public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList,
91 UUID insigniaID, int membershipFee, bool openEnrollment,
92 bool allowPublish, bool maturePublish)
93 {
94 }
95
96 public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description,
97 string title, ulong powers)
98 {
99 }
100
101 public void RemoveGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID)
102 {
103 }
104
105 public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description,
106 string title, ulong powers)
107 {
108 }
109
110 public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID GroupID, string GroupName)
111 {
112 return null;
113 }
114
115 public GroupProfileData GetMemberGroupProfile(UUID requestingAgentID, UUID GroupID, UUID AgentID)
116 {
117 return default(GroupProfileData);
118 }
119
120 public void SetAgentActiveGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID)
121 {
122 }
123
124 public void SetAgentActiveGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
125 {
126 }
127
128 public void SetAgentGroupInfo(UUID requestingAgentID, UUID AgentID, UUID GroupID, bool AcceptNotices, bool ListInProfile)
129 {
130 }
131
132 public void AddAgentToGroupInvite(UUID requestingAgentID, UUID inviteID, UUID groupID, UUID roleID, UUID agentID)
133 {
134 }
135
136 public GroupInviteInfo GetAgentToGroupInvite(UUID requestingAgentID, UUID inviteID)
137 {
138 return null;
139 }
140
141 public void RemoveAgentToGroupInvite(UUID requestingAgentID, UUID inviteID)
142 {
143 }
144
145 public void AddAgentToGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
146 {
147 }
148
149 public void RemoveAgentFromGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID)
150 {
151 }
152
153 public void AddAgentToGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
154 {
155 }
156
157 public void RemoveAgentFromGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
158 {
159 }
160
161 public List<DirGroupsReplyData> FindGroups(UUID requestingAgentID, string search)
162 {
163 return null;
164 }
165
166 public GroupMembershipData GetAgentGroupMembership(UUID requestingAgentID, UUID AgentID, UUID GroupID)
167 {
168 return null;
169 }
170
171 public GroupMembershipData GetAgentActiveMembership(UUID requestingAgentID, UUID AgentID)
172 {
173 return null;
174 }
175
176 public List<GroupMembershipData> GetAgentGroupMemberships(UUID requestingAgentID, UUID AgentID)
177 {
178 return new List<GroupMembershipData>();
179 }
180
181 public List<GroupRolesData> GetAgentGroupRoles(UUID requestingAgentID, UUID AgentID, UUID GroupID)
182 {
183 return null;
184 }
185
186 public List<GroupRolesData> GetGroupRoles(UUID requestingAgentID, UUID GroupID)
187 {
188 return null;
189 }
190
191 public List<GroupMembersData> GetGroupMembers(UUID requestingAgentID, UUID GroupID)
192 {
193 return null;
194 }
195
196 public List<GroupRoleMembersData> GetGroupRoleMembers(UUID requestingAgentID, UUID GroupID)
197 {
198 return null;
199 }
200
201 public List<GroupNoticeData> GetGroupNotices(UUID requestingAgentID, UUID GroupID)
202 {
203 return null;
204 }
205
206 public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID)
207 {
208 return null;
209 }
210
211 public void AddGroupNotice(UUID requestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket)
212 {
213 }
214
215 public void ResetAgentGroupChatSessions(UUID agentID)
216 {
217 }
218
219 public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID)
220 {
221 return false;
222 }
223
224 public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID)
225 {
226 return false;
227 }
228
229 public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID)
230 {
231 }
232
233 public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID)
234 {
235 }
236 }
237} \ No newline at end of file
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index 9d7733e..8b16496 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -424,9 +424,12 @@ namespace OpenSim.Tests.Common.Setup
424 foreach (IRegionModuleBase module in newModules) 424 foreach (IRegionModuleBase module in newModules)
425 { 425 {
426 module.AddRegion(scene); 426 module.AddRegion(scene);
427 module.RegionLoaded(scene);
428 scene.AddRegionModule(module.Name, module); 427 scene.AddRegionModule(module.Name, module);
429 } 428 }
429
430 // RegionLoaded is fired after all modules have been appropriately added to all scenes
431 foreach (IRegionModuleBase module in newModules)
432 module.RegionLoaded(scene);
430 433
431 scene.SetModuleInterfaces(); 434 scene.SetModuleInterfaces();
432 } 435 }