From a416e75ddba9de7448c00ecb88cb2f1a1949dac2 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 19 Apr 2009 00:11:14 +0000 Subject: Thank you kindly, MCortez, for a patch that: This hooks up the LandManagementModule to handle the DeedParcelToGroup packet. Now people can start testing land assigned to and owned by groups. Also fixes a viewer crash issue when searching for and then joining a group with an agent that is not already being tracked by groups server. --- .../CoreModules/World/Land/LandManagementModule.cs | 23 +++++++++++++++++++++- .../Region/CoreModules/World/Land/LandObject.cs | 12 +++++++++++ OpenSim/Region/Framework/Interfaces/ILandObject.cs | 2 ++ .../Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs | 5 ++++- 4 files changed, 40 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 4ae617d..d7bd78b 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -121,7 +121,9 @@ namespace OpenSim.Region.CoreModules.World.Land client.OnParcelReclaim += new ParcelReclaim(handleParcelReclaim); client.OnParcelInfoRequest += new ParcelInfoRequest(handleParcelInfo); client.OnParcelDwellRequest += new ParcelDwellRequest(handleParcelDwell); - + + client.OnParcelDeedToGroup += new ParcelDeedToGroup(handleParcelDeedToGroup); + if (m_scene.Entities.ContainsKey(client.AgentId)) { SendLandUpdate((ScenePresence)m_scene.Entities[client.AgentId], true); @@ -129,6 +131,7 @@ namespace OpenSim.Region.CoreModules.World.Land } } + public void PostInitialise() { } @@ -1125,6 +1128,24 @@ namespace OpenSim.Region.CoreModules.World.Land } } + + void handleParcelDeedToGroup(int parcelLocalID, UUID groupID, IClientAPI remote_client) + { + // TODO: May want to validate that the group id is valid and that the remote client has the right to deed + ILandObject land; + lock (m_landList) + { + m_landList.TryGetValue(parcelLocalID, out land); + } + + if (land != null) + { + land.deedToGroup(groupID); + } + + } + + #region Land Object From Storage Functions public void IncomingLandObjectsFromStorage(List data) diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 2cf739b..ce66e46 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -232,6 +232,18 @@ namespace OpenSim.Region.CoreModules.World.Land sendLandUpdateToAvatarsOverMe(); } + public void deedToGroup(UUID groupID) + { + LandData newData = landData.Copy(); + newData.OwnerID = groupID; + newData.GroupID = groupID; + newData.IsGroupOwned = true; + + m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); + + sendLandUpdateToAvatarsOverMe(); + } + public bool isEitherBannedOrRestricted(UUID avatar) { if (isBannedFromLand(avatar)) diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs index db3c9bf..1945b98 100644 --- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs +++ b/OpenSim/Region/Framework/Interfaces/ILandObject.cs @@ -76,6 +76,8 @@ namespace OpenSim.Region.Framework.Interfaces void removePrimFromCount(SceneObjectGroup obj); void updateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area); + void deedToGroup(UUID groupID); + void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs index 6252d56..5ebab65 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs @@ -552,7 +552,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { GroupTitlesData title = new GroupTitlesData(); title.Name = role.Name; - title.Selected = agentMembership.ActiveRole == role.RoleID; + if (agentMembership != null) + { + title.Selected = agentMembership.ActiveRole == role.RoleID; + } title.UUID = role.RoleID; } -- cgit v1.1